mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 12:04:35 +00:00
ece8779362
Since commit 940f32c1a8
building the Tracy
library on Linux using a GCC version < 11 would result in compile errors
due to symbol redefinitions of __get_cpuid_max, __get_cpuid and
__get_cpuid_count.
This is because prior to GCC 11 the cpuid.h header file did not have any
include guards and thus including this header more than once would
produce the abovementioned errors.
To work around this issue, including cpuid.h has been wrapped into a
custom header file that itself uses include guards and thus shields
cpuid.h from being included multiple times.
Fixes #452
13 lines
435 B
C++
13 lines
435 B
C++
#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
|