* Reorder extern "C" and visibility statements
In file included from coreclr/src/pal/inc/pal.h:70:0,
coreclr/src/pal/inc/pal_mstypes.h:30:25: error: expected unqualified-id
before string constant
#define EXTERN_C extern "C"
^
coreclr/src/pal/inc/rt/palrt.h:216:30: note:
in expansion of macro 'EXTERN_C'
#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
* Need double quotes around single quotes in error statements
fix error statements
Can't have ' character in error statement
* Abstract __declspec(noinline)
Generate compiler independent macros for noinline request.
* Remove unused DBG_NOINLINE_X86__RET_INLINE
* Abstract __declspec(nothrow)
Commit migrated from https://github.com/dotnet/coreclr/commit/
36931ac7b24249201547f7ca667105014b2e4c7f
#define _EXPRESSION_NODE_
#ifdef FEATURE_PAL
-#error This file isn't designed to build in PAL
+#error "This file isn't designed to build in PAL"
#endif
#include "strike.h"
TimeSpecAdd(&endTime, milliseconds);
}
#else
-#error Don't know how to perfom timed wait on this platform
+#error "Don't know how to perfom timed wait on this platform"
#endif
int st = 0;
};
- __declspec(nothrow) BaseContract() : m_pClrDebugState(NULL), m_testmask(0)
+ NOTHROW_DECL BaseContract() : m_pClrDebugState(NULL), m_testmask(0)
{
}
- __declspec(nothrow) void Restore()
+ NOTHROW_DECL void Restore()
{
// m_pClrDebugState is setup in BaseContract::DoChecks. If an SO happens after the
// BaseContract object is constructed but before DoChecks is invoked, m_pClrDebugState
virtual void DestructorDefinedThatCallsRestore(){}
public:
- __declspec(nothrow) ~Contract()
+ NOTHROW_DECL ~Contract()
{
Restore();
}
#ifndef DEBUG_NOINLINE
#if defined(_DEBUG)
-#define DEBUG_NOINLINE __declspec(noinline)
+#define DEBUG_NOINLINE NOINLINE
#else
#define DEBUG_NOINLINE
#endif
#endif
-#ifndef DBG_NOINLINE_X86__RET_INLINE
-#if defined(_DEBUG) && defined(_X86_)
-#define DBG_NOINLINE_X86__RET_INLINE __declspec(noinline)
-#else
-#define DBG_NOINLINE_X86__RET_INLINE FORCEINLINE
-#endif
-#endif
-
#ifndef NOINLINE
#ifdef _MSC_VER
#define NOINLINE __declspec(noinline)
return NoteAccessWorker(address);
}
- __declspec(noinline) static void* NoteAccessWorker(void *address)
+ NOINLINE static void* NoteAccessWorker(void *address)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_GC_NOTRIGGER;
NoteSearchWorker(result);
}
- __declspec(noinline) static void NoteSearchWorker(void *result)
+ NOINLINE static void NoteSearchWorker(void *result)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_GC_NOTRIGGER;
#endif
#endif
+#ifndef NOTHROW_DECL
+#ifdef _MSC_VER
+#define NOTHROW_DECL __declspec(nothrow)
+#else
+#define NOTHROW_DECL __attribute__((nothrow))
+#endif // !_MSC_VER
+#endif // !NOTHROW_DECL
+
+#ifndef NOINLINE
+#ifdef _MSC_VER
+#define NOINLINE __declspec(noinline)
+#else
+#define NOINLINE __attribute__((noinline))
+#endif // !_MSC_VER
+#endif // !NOINLINE
+
//
// CPP_ASSERT() can be used within a class definition, to perform a
// compile-time assertion involving private names within the class.
//-----------------------------------------------------------------------------
//#ifndef _H_UTIL
-//#error I am a part of util.hpp Please don't include me alone !
+//#error "I am a part of util.hpp Please don't include me alone !"
//#endif
#ifndef DEBUG_NOINLINE
#if defined(_DEBUG)
-#define DEBUG_NOINLINE __declspec(noinline)
+#define DEBUG_NOINLINE NOINLINE
#else
#define DEBUG_NOINLINE
#endif
#endif
-#ifndef DBG_NOINLINE_X86__RET_INLINE
-#if defined(_DEBUG) && defined(_TARGET_X86_)
-// this exists to make scan work on x86.
-#define DBG_NOINLINE_X86__RET_INLINE __declspec(noinline)
-#else
-#define DBG_NOINLINE_X86__RET_INLINE FORCEINLINE
-#endif
-#endif
-
#include <stddef.h> // for offsetof
#ifndef NumItems
// to see HRESULT propagation.
//
#ifdef DEBUG
- inline HRESULT __declspec(noinline) _FailedHR(HRESULT hr) { static HRESULT _hr = hr; return hr; }
+ inline HRESULT NOINLINE _FailedHR(HRESULT hr) { static HRESULT _hr = hr; return hr; }
#else
inline HRESULT _FailedHR(HRESULT hr) { return hr; }
#endif
#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
+#define STDAPI_VIS(vis,type) EXTERN_C vis type STDAPICALLTYPE
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
/******************* OLE, BSTR, VARIANT *************************/
-DLLEXPORT STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb);
-DLLEXPORT STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb);
-DLLEXPORT STDAPI_(void) CoTaskMemFree(LPVOID pv);
+STDAPI_VIS(DLLEXPORT, LPVOID) CoTaskMemAlloc(SIZE_T cb);
+STDAPI_VIS(DLLEXPORT, LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb);
+STDAPI_VIS(DLLEXPORT, void) CoTaskMemFree(LPVOID pv);
typedef SHORT VARIANT_BOOL;
#define VARIANT_TRUE ((VARIANT_BOOL)-1)
typedef WCHAR *BSTR;
-DLLEXPORT STDAPI_(BSTR) SysAllocString(const OLECHAR*);
-DLLEXPORT STDAPI_(BSTR) SysAllocStringLen(const OLECHAR*, UINT);
-DLLEXPORT STDAPI_(BSTR) SysAllocStringByteLen(const char *, UINT);
-DLLEXPORT STDAPI_(void) SysFreeString(BSTR);
-DLLEXPORT STDAPI_(UINT) SysStringLen(BSTR);
-DLLEXPORT STDAPI_(UINT) SysStringByteLen(BSTR);
+STDAPI_VIS(DLLEXPORT, BSTR) SysAllocString(const OLECHAR*);
+STDAPI_VIS(DLLEXPORT, BSTR) SysAllocStringLen(const OLECHAR*, UINT);
+STDAPI_VIS(DLLEXPORT, BSTR) SysAllocStringByteLen(const char *, UINT);
+STDAPI_VIS(DLLEXPORT, void) SysFreeString(BSTR);
+STDAPI_VIS(DLLEXPORT, UINT) SysStringLen(BSTR);
+STDAPI_VIS(DLLEXPORT, UINT) SysStringByteLen(BSTR);
typedef double DATE;
#ifdef __cplusplus // [
#ifndef __nothrow // [
-# define __nothrow __declspec(nothrow)
+# define __nothrow NOTHROW_DECL
#endif // ]
extern "C" {
#else // ][
ArgIterator m_argIt;
#ifdef _DEBUG
- __declspec(noinline) void LogWeakAssert()
+ NOINLINE void LogWeakAssert()
{
LIMITED_METHOD_CONTRACT;
LOG((LF_ASSERT, LL_WARNING, "%s::%s\n", m_pMD->m_pszDebugClassName, m_pMD->m_pszDebugMethodName));
e_HAS_EXPLICIT_SIZE = 0x08,
#ifdef UNIX_AMD64_ABI
#ifdef FEATURE_HFA
-#error Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time.
+#error "Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time."
#endif // FEATURE_HFA
e_NATIVE_PASS_IN_REGISTERS = 0x10, // Flag wheter a native struct is passed in registers.
#endif // UNIX_AMD64_ABI
CrstBase *GetThreadsOwnedCrsts();
void SetThreadsOwnedCrsts(CrstBase *pCrst);
- __declspec(noinline) EEThreadId GetHolderThreadId()
+ NOINLINE EEThreadId GetHolderThreadId()
{
LIMITED_METHOD_CONTRACT;
return m_holderthreadid;
virtual void DestructorDefinedThatCallsRestore(){}
public:
- __declspec(nothrow) ~EEContract()
+ NOTHROW_DECL ~EEContract()
{
Restore();
}
#endif // _TARGET_ARM_ || _TARGET_ARM64_ || _TARGET_X86_
#ifndef FEATURE_PAL
-void __declspec(noinline)
+void NOINLINE
ClrUnwindEx(EXCEPTION_RECORD* pExceptionRecord,
UINT_PTR ReturnValue,
UINT_PTR TargetIP,
// This helper is here to avoid EH goo associated with DefineFullyQualifiedNameForStack being
// invoked when logging is off.
-__declspec(noinline)
+NOINLINE
void LogFinalization(Object* obj)
{
STATIC_CONTRACT_NOTHROW;
} \
\
private: \
- __declspec(noinline) static void Log##name##AccessStatic(const void * p) \
+ NOINLINE static void Log##name##AccessStatic(const void * p) \
{ \
WRAPPER_NO_CONTRACT; \
/* To make the logging callsite as small as */ \
#if defined(FEATURE_HFA)
#if defined(UNIX_AMD64_ABI)
-#error Can't define both FEATURE_HFA and UNIX_AMD64_ABI
+#error "Can't define both FEATURE_HFA and UNIX_AMD64_ABI"
#endif
enum_flag_IsHFA = 0x00000800, // This type is an HFA (Homogenous Floating-point Aggregate)
#endif // FEATURE_HFA
#if defined(UNIX_AMD64_ABI)
#if defined(FEATURE_HFA)
-#error Can't define both FEATURE_HFA and UNIX_AMD64_ABI
+#error "Can't define both FEATURE_HFA and UNIX_AMD64_ABI"
#endif
enum_flag_IsRegStructPassed = 0x00000800, // This type is a System V register passed struct.
#endif // UNIX_AMD64_ABI
#endif
#ifdef UNIX_AMD64_ABI
#ifdef FEATURE_HFA
-#error Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time.
+#error "Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time."
#endif // FEATURE_HFA
SystemVAmd64CheckForPassStructInRegister();
#endif // UNIX_AMD64_ABI
#ifdef UNIX_AMD64_ABI
#ifdef FEATURE_HFA
-#error Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time.
+#error "Can't have FEATURE_HFA and UNIX_AMD64_ABI defined at the same time."
#endif // FEATURE_HFA
if (HasLayout())
{
return FALSE;
}
-__declspec(noinline) void AllocateSomeStack(){
+NOINLINE void AllocateSomeStack(){
LIMITED_METHOD_CONTRACT;
#ifdef _TARGET_X86_
const size_t size = 0x200;