diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2015-04-17 01:35:47 +0200 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2015-04-17 01:35:47 +0200 |
commit | cf30541e86f27348d9fe132b88d82bda211ab867 (patch) | |
tree | f0228e47469c37f3674a8a3eedc24fe697af7cd4 | |
parent | d067efd6c54ff66cca85b96eefbcdcc3bad4ecb4 (diff) | |
download | coreclr-cf30541e86f27348d9fe132b88d82bda211ab867.tar.gz coreclr-cf30541e86f27348d9fe132b88d82bda211ab867.tar.bz2 coreclr-cf30541e86f27348d9fe132b88d82bda211ab867.zip |
Fix the return macro on Windows
There seems to be a bug in the VC++ compiler that causes the
following error to occur:
ex.cpp(492): fatal error C1061: compiler limit : blocks nested too deeply
There seems to be no nesting when I look at preprocessed source of the ex.cpp
and it builds fine on Unix.
To make the Windows build happy, I have left the return macro definition
for MSVC as it was before my change and only changed it for other compilers.
-rw-r--r-- | src/inc/debugreturn.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/inc/debugreturn.h b/src/inc/debugreturn.h index 74567534b1..a2dae5d61e 100644 --- a/src/inc/debugreturn.h +++ b/src/inc/debugreturn.h @@ -93,7 +93,11 @@ typedef __SafeToReturn __ReturnOK; // The call is dead, and does not appear in the generated code, even in a checked // build. (And, in fastchecked, there is no penalty at all.) // +#ifdef _MSC_VER +#define return if (0 && __ReturnOK::safe_to_return()) { } else return +#else // _MSC_VER #define return for (;1;__ReturnOK::safe_to_return()) return +#endif // _MSC_VER #define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) { typedef __YouCannotUseAReturnStatementHere __ReturnOK; if (0 && __ReturnOK::used()) { } else { #define DEBUG_ASSURE_NO_RETURN_END(arg) } } |