mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-13 22:08:16 +00:00
Fix error suppression macro
My previous fix triggered another issue: apparently at least GCC expects the `_Pragma` operator to be placed in its own statement (after a semicolon). The current macro simply dumped the expression and the _Pragma together, triggering an error. Putting a semicolon after `Expr` fixes the issue (actually double-checked after a `git clean -fdx`), although slightly changing the API (the semicolon after the wrapped macros is now optional).
This commit is contained in:
@@ -155,19 +155,19 @@
|
||||
#define SuppressVarShadowWarning(Expr) \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
|
||||
Expr \
|
||||
Expr; \
|
||||
_Pragma("clang diagnostic pop")
|
||||
#elif defined(__GNUC__)
|
||||
#define SuppressVarShadowWarning(Expr) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
|
||||
Expr \
|
||||
Expr; \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
#elif defined(_MSC_VER)
|
||||
#define SuppressVarShadowWarning(Expr) \
|
||||
_Pragma("warning(push)") \
|
||||
_Pragma("warning(disable : 4456)") \
|
||||
Expr \
|
||||
Expr; \
|
||||
_Pragma("warning(pop)")
|
||||
#else
|
||||
#define SuppressVarShadowWarning(Expr) Expr
|
||||
|
||||
Reference in New Issue
Block a user