From 4ddc41e60c6f4382c350b9b5cbcc0fd2e903c1e7 Mon Sep 17 00:00:00 2001 From: Peter Jas Date: Wed, 10 Aug 2016 09:12:51 +0300 Subject: Fix for VCR 190024210 and Win SDK 10.0.14393.0 (#6674) --- src/inc/debugreturn.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/inc') diff --git a/src/inc/debugreturn.h b/src/inc/debugreturn.h index cc5bdebb5a..dbcbd2bb46 100644 --- a/src/inc/debugreturn.h +++ b/src/inc/debugreturn.h @@ -27,7 +27,9 @@ #else // !_PREFAST_ -#ifdef _DEBUG +// This is disabled in VS2015 Update 3 and earlier because only C++11 constexpr is supported, +// which doesn't allow the use of 'if' statements within the body of a constexpr function. +#if defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210) // Code to generate a compile-time error if return statements appear where they // shouldn't. @@ -108,15 +110,17 @@ typedef __SafeToReturn __ReturnOK; #define DEBUG_OK_TO_RETURN_BEGIN(arg) { typedef __SafeToReturn __ReturnOK; if (0 && __ReturnOK::used()) { } else { #define DEBUG_OK_TO_RETURN_END(arg) } } -#else // !_DEBUG +#else // defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210) -#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) -#define DEBUG_ASSURE_NO_RETURN_END(arg) +#define DEBUG_ASSURE_SAFE_TO_RETURN TRUE + +#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) { +#define DEBUG_ASSURE_NO_RETURN_END(arg) } -#define DEBUG_OK_TO_RETURN_BEGIN(arg) -#define DEBUG_OK_TO_RETURN_END(arg) +#define DEBUG_OK_TO_RETURN_BEGIN(arg) { +#define DEBUG_OK_TO_RETURN_END(arg) } -#endif // !_DEBUG +#endif // defined(_DEBUG) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024210) #endif // !_PREFAST_ -- cgit v1.2.3