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.
This commit is contained in:
Bartosz Taudul 2022-11-09 21:55:41 +01:00
parent c0035a492f
commit 2c03306341
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -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 <elfutils/debuginfod.h>
@ -21,7 +29,6 @@
#include <stdint.h>
#include "../common/TracyAlloc.hpp"
#include "../common/TracyForceInline.hpp"
namespace tracy
{