mirror of
https://github.com/wolfpld/tracy
synced 2025-05-05 22:53:52 +00:00
Merge pull request #453 from Krzmbrzl/fix-cpuid-compile-error
Fix cpuid symbol redefinition on older GCC versions
This commit is contained in:
commit
5289a9c999
12
public/client/TracyCpuid.hpp
Normal file
12
public/client/TracyCpuid.hpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef __TRACYCPUID_HPP__
|
||||||
|
#define __TRACYCPUID_HPP__
|
||||||
|
|
||||||
|
// Prior to GCC 11 the cpuid.h header did not have any include guards and thus
|
||||||
|
// including it more than once would cause a compiler error due to symbol
|
||||||
|
// redefinitions. In order to support older GCC versions, we have to wrap this
|
||||||
|
// include between custom include guards to prevent this issue.
|
||||||
|
// See also https://github.com/wolfpld/tracy/issues/452
|
||||||
|
|
||||||
|
#include <cpuid.h>
|
||||||
|
|
||||||
|
#endif
|
@ -106,7 +106,7 @@ extern "C" typedef BOOL (WINAPI *t_GetLogicalProcessorInformationEx)( LOGICAL_PR
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined _WIN32 && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
|
#if !defined _WIN32 && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
|
||||||
# include <cpuid.h>
|
# include "TracyCpuid.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !( ( defined _WIN32 && _WIN32_WINNT >= _WIN32_WINNT_VISTA ) || defined __linux__ )
|
#if !( ( defined _WIN32 && _WIN32_WINNT >= _WIN32_WINNT_VISTA ) || defined __linux__ )
|
||||||
|
@ -609,7 +609,7 @@ void SysTraceGetExternalName( uint64_t thread, const char*& threadName, const ch
|
|||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
|
|
||||||
# if defined __i386 || defined __x86_64__
|
# if defined __i386 || defined __x86_64__
|
||||||
# include <cpuid.h>
|
# include "TracyCpuid.hpp"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# include "TracyProfiler.hpp"
|
# include "TracyProfiler.hpp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user