From 2c03306341cde61b1de950e5303b855ed3720619 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 9 Nov 2022 21:55:41 +0100 Subject: [PATCH] Always provide Callstack() implementation, even if dummy. This fixes usage with TRACY_HAS_CALLSTACK undefined, allowing compilation of otherwise unused functions, which are already protected from being called through macro redirections. See https://github.com/wolfpld/tracy/pull/492 for more information. --- public/client/TracyCallstack.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/client/TracyCallstack.hpp b/public/client/TracyCallstack.hpp index 5c24e7db..0b522b73 100644 --- a/public/client/TracyCallstack.hpp +++ b/public/client/TracyCallstack.hpp @@ -2,6 +2,7 @@ #define __TRACYCALLSTACK_HPP__ #include "../common/TracyApi.h" +#include "../common/TracyForceInline.hpp" #include "TracyCallstack.h" #if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 5 @@ -11,7 +12,14 @@ #endif -#ifdef TRACY_HAS_CALLSTACK +#ifndef TRACY_HAS_CALLSTACK + +namespace tracy +{ +static tracy_force_inline void* Callstack( int depth ) { return nullptr; } +} + +#else #ifdef TRACY_DEBUGINFOD # include @@ -21,7 +29,6 @@ #include #include "../common/TracyAlloc.hpp" -#include "../common/TracyForceInline.hpp" namespace tracy {