From c03884d20c1f6b1c552d9c512f066c8214ef9fdb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 9 Feb 2024 14:45:28 +0100 Subject: [PATCH] Add TracyNoop macro. --- public/tracy/Tracy.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/tracy/Tracy.hpp b/public/tracy/Tracy.hpp index c557a2c8..296d4d8a 100644 --- a/public/tracy/Tracy.hpp +++ b/public/tracy/Tracy.hpp @@ -18,6 +18,8 @@ #ifndef TRACY_ENABLE +#define TracyNoop + #define ZoneNamed(x,y) #define ZoneNamedN(x,y,z) #define ZoneNamedC(x,y,z) @@ -123,6 +125,8 @@ #include "../client/TracyProfiler.hpp" #include "../client/TracyScoped.hpp" +#define TracyNoop tracy::ProfilerAvailable() + #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK # define ZoneNamed( varname, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { nullptr, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), TRACY_CALLSTACK, active ) # define ZoneNamedN( varname, name, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), TRACY_CALLSTACK, active )