mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Use language neutral header for callstack capability detection.
This fixes call stack collection in C API when TRACY_CALLSTACK is defined.
This commit is contained in:
parent
16b398ffeb
commit
a708bebbfd
2
TracyC.h
2
TracyC.h
@ -4,6 +4,8 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "client/TracyCallstack.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
16
client/TracyCallstack.h
Normal file
16
client/TracyCallstack.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef __TRACYCALLSTACK_H__
|
||||||
|
#define __TRACYCALLSTACK_H__
|
||||||
|
|
||||||
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
|
# define TRACY_HAS_CALLSTACK 1
|
||||||
|
#elif defined __ANDROID__
|
||||||
|
# define TRACY_HAS_CALLSTACK 2
|
||||||
|
#elif defined __linux
|
||||||
|
# if defined _GNU_SOURCE && defined __GLIBC__
|
||||||
|
# define TRACY_HAS_CALLSTACK 3
|
||||||
|
# else
|
||||||
|
# define TRACY_HAS_CALLSTACK 2
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -1,24 +1,18 @@
|
|||||||
#ifndef __TRACYCALLSTACK_HPP__
|
#ifndef __TRACYCALLSTACK_HPP__
|
||||||
#define __TRACYCALLSTACK_HPP__
|
#define __TRACYCALLSTACK_HPP__
|
||||||
|
|
||||||
#if defined _WIN32 || defined __CYGWIN__
|
#include "TracyCallstack.h"
|
||||||
# define TRACY_HAS_CALLSTACK 1
|
|
||||||
|
#if TRACY_HAS_CALLSTACK == 1
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
typedef unsigned long (__stdcall *t_RtlWalkFrameChain)( void**, unsigned long, unsigned long );
|
typedef unsigned long (__stdcall *t_RtlWalkFrameChain)( void**, unsigned long, unsigned long );
|
||||||
extern t_RtlWalkFrameChain RtlWalkFrameChain;
|
extern t_RtlWalkFrameChain RtlWalkFrameChain;
|
||||||
}
|
}
|
||||||
#elif defined __ANDROID__
|
#elif TRACY_HAS_CALLSTACK == 2
|
||||||
# define TRACY_HAS_CALLSTACK 2
|
|
||||||
# include <unwind.h>
|
# include <unwind.h>
|
||||||
#elif defined __linux
|
#elif TRACY_HAS_CALLSTACK == 3
|
||||||
# if defined _GNU_SOURCE && defined __GLIBC__
|
# include <execinfo.h>
|
||||||
# define TRACY_HAS_CALLSTACK 3
|
|
||||||
# include <execinfo.h>
|
|
||||||
# else
|
|
||||||
# define TRACY_HAS_CALLSTACK 2
|
|
||||||
# include <unwind.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user