diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2015-05-25 13:05:52 +0200 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2015-05-26 14:37:51 +0200 |
commit | 554267efce64aa1df66b1e614a8710217afb3a91 (patch) | |
tree | 984d36c03111242ad7fe505097035276c953f19d /src | |
parent | 2e7885d43ffbae93891fac2313ac5450be661435 (diff) | |
download | coreclr-554267efce64aa1df66b1e614a8710217afb3a91.tar.gz coreclr-554267efce64aa1df66b1e614a8710217afb3a91.tar.bz2 coreclr-554267efce64aa1df66b1e614a8710217afb3a91.zip |
Fix the implicit-exception-spec-mismatch warning
Fix the warning. Since VC++ until VS2015 doesn't support the noexcept keyword,
define a NOEXCEPT macro as empty for VC++ older than VS2015 and as noexcept for others.
Diffstat (limited to 'src')
-rw-r--r-- | src/inc/utilcode.h | 10 | ||||
-rw-r--r-- | src/utilcode/clrhost_nodependencies.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index 9fa52abe38..bcb8713018 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -189,6 +189,12 @@ typedef LPSTR LPUTF8; #define sizeofmember(c,m) (sizeof(((c*)0)->m)) #endif +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define NOEXCEPT +#else +#define NOEXCEPT noexcept +#endif + //=--------------------------------------------------------------------------= // Prefast helpers. // @@ -506,10 +512,10 @@ _Ret_bytecap_(_Size) void * __cdecl operator new[](size_t n); void __cdecl -operator delete(void *p); +operator delete(void *p) NOEXCEPT; void __cdecl -operator delete[](void *p); +operator delete[](void *p) NOEXCEPT; #ifdef _DEBUG_IMPL HRESULT _OutOfMemory(LPCSTR szFile, int iLine); diff --git a/src/utilcode/clrhost_nodependencies.cpp b/src/utilcode/clrhost_nodependencies.cpp index 63f0f6328b..33f270ecb3 100644 --- a/src/utilcode/clrhost_nodependencies.cpp +++ b/src/utilcode/clrhost_nodependencies.cpp @@ -471,7 +471,7 @@ void * __cdecl operator new[](size_t n, const NoThrow&) __attribute__((visibility("hidden"))) #endif void __cdecl -operator delete(void *p) +operator delete(void *p) NOEXCEPT { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; @@ -487,7 +487,7 @@ operator delete(void *p) __attribute__((visibility("hidden"))) #endif void __cdecl -operator delete[](void *p) +operator delete[](void *p) NOEXCEPT { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; |