wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.24k stars 691 forks source link

fix CpuId when compiling with clang on windows #836

Closed Techatrix closed 4 months ago

Techatrix commented 4 months ago

The __cpuidex intrinsic is only offered by msvc.

PS C:\Users\Techatrix\zls> zig c++ --version
clang version 18.1.7 (https://github.com/ziglang/zig-bootstrap ec2dca85a340f134d2fcfdc9007e91f9abed6996)
Target: x86_64-unknown-windows-gnu  
Thread model: posix
InstalledDir: C:/Users/Techatrix/zls

PS C:\Users\Techatrix\zls> zig c++ -c .\src\tracy\public\TracyClient.cpp -DTRACY_ENABLE=1
In file included from .\src\tracy\public\TracyClient.cpp:23:
.\src\tracy\public/client/TracyProfiler.cpp:312:5: error: use of undeclared identifier '__cpuidex'
  312 |     __cpuidex( (int*)regs, leaf, 0 );
      |     ^
1 error generated.