diff --git a/public/tracy/Tracy.hpp b/public/tracy/Tracy.hpp index 98957f6d..6c8a80b1 100644 --- a/public/tracy/Tracy.hpp +++ b/public/tracy/Tracy.hpp @@ -149,10 +149,32 @@ #define ZoneTransientN( varname, name, active ) tracy::ScopedZone varname( TracyLine, TracyFile, strlen( TracyFile ), TracyFunction, strlen( TracyFunction ), name, strlen( name ), TRACY_CALLSTACK, active ) #define ZoneTransientNC( varname, name, color, active ) tracy::ScopedZone varname( TracyLine, TracyFile, strlen( TracyFile ), TracyFunction, strlen( TracyFunction ), name, strlen( name ), color, TRACY_CALLSTACK, active ) -#define ZoneScoped ZoneNamed( ___tracy_scoped_zone, true ) -#define ZoneScopedN( name ) ZoneNamedN( ___tracy_scoped_zone, name, true ) -#define ZoneScopedC( color ) ZoneNamedC( ___tracy_scoped_zone, color, true ) -#define ZoneScopedNC( name, color ) ZoneNamedNC( ___tracy_scoped_zone, name, color, true ) +#if defined(__clang__) + #define SuppressVarShadowWarning(Expr) \ + _Pragma("clang diagnostic push"); \ + _Pragma("clang diagnostic ignored \"-Wshadow\""); \ + Expr; \ + _Pragma("clang diagnostic pop"); +#elif defined(__GNU__) + #define SuppressVarShadowWarning(Expr) \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wshadow\""); \ + Expr; \ + _Pragma("GCC diagnostic pop"); +#elif defined(_MSC_VER) + #define SuppressVarShadowWarning(Expr) \ + _Pragma("warning(push)"); \ + _Pragma("warning(disable : 4456)"); \ + Expr; \ + _Pragma("warning(pop)"); +#else + #define SuppressVarShadowWarning(Expr) Expr +#endif + +#define ZoneScoped SuppressVarShadowWarning( ZoneNamed( ___tracy_scoped_zone, true ) ) +#define ZoneScopedN( name ) SuppressVarShadowWarning( ZoneNamedN( ___tracy_scoped_zone, name, true ) ) +#define ZoneScopedC( color ) SuppressVarShadowWarning( ZoneNamedC( ___tracy_scoped_zone, color, true ) ) +#define ZoneScopedNC( name, color ) SuppressVarShadowWarning( ZoneNamedNC( ___tracy_scoped_zone, name, color, true ) ) #define ZoneText( txt, size ) ___tracy_scoped_zone.Text( txt, size ) #define ZoneTextV( varname, txt, size ) varname.Text( txt, size )