more warnings.h - macOS issue

It turns out that macOS barked when a POP was issued without
a prior PUSH, so since the DISABLE_WARNING_CONDEXPR_IS_CONSTANT
expanded to an empty macro on that platform.

Include a corresponding
RESTORE_WARNING_CONDEXPR_IS_CONSTANT macro for use with that
particular warning.
This commit is contained in:
nhmall
2021-02-01 13:37:04 -05:00
parent 6aa94ebf57
commit e25b16e844
3 changed files with 5 additions and 2 deletions

View File

@@ -35,6 +35,7 @@
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNINGS _Pragma("clang diagnostic pop")
#define STDC_Pragma_AVAILABLE
@@ -44,6 +45,7 @@
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#define RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
#define STDC_Pragma_AVAILABLE
@@ -54,6 +56,7 @@
#define DISABLE_WARNING_CONDEXPR_IS_CONSTANT \
_Pragma("warning( push )") \
_Pragma("warning( disable : 4127 )")
#define RESTORE_WARNINGCONDEXPR_IS_CONSTANT _Pragma("warning( pop )")
#define RESTORE_WARNINGS _Pragma("warning( pop )")
#define STDC_Pragma_AVAILABLE

View File

@@ -1539,7 +1539,7 @@ wiz_smell(void)
return 0;
}
RESTORE_WARNINGS
RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#define DEFAULT_TIMEOUT_INCR 30

View File

@@ -382,7 +382,7 @@ nhl_getmap(lua_State *L)
return 1;
}
RESTORE_WARNINGS
RESTORE_WARNING_CONDEXPR_IS_CONSTANT
/* pline("It hits!") */
static int