Avoid -Wshadow warnings when using multiple wxCHECK()s

If the same function used any of macros from wxCHECK() family more than
once, wxDummyCheckStruct was redeclared, resulting in -Wshadow warnings
from gcc.

Fix this by using unique names for the dummy macro.
This commit is contained in:
Vadim Zeitlin
2020-08-25 17:37:25 +02:00
parent 054d98b1df
commit 1ec571fb64

View File

@@ -371,7 +371,7 @@ extern void WXDLLIMPEXP_BASE wxAbort();
wxFAIL_COND_MSG(#cond, msg); \ wxFAIL_COND_MSG(#cond, msg); \
op; \ op; \
} \ } \
struct wxDummyCheckStruct /* just to force a semicolon */ struct wxMAKE_UNIQUE_NAME(wxDummyCheckStruct) /* to force a semicolon */
// check which returns with the specified return code if the condition fails // check which returns with the specified return code if the condition fails
#define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg) #define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg)