wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.64k stars 595 forks source link

Added preprocessor checks for Clang on Windows #733

Closed Razakhel closed 4 months ago

Razakhel commented 4 months ago

MSVC-specific code is used in some places (__try, __except and __forceinline) and compiled only if _MSC_VER is set; however, Clang under Windows also defines this, which reports errors on this non-standard code if the -pedantic-errors compiler flag is set:

In file included from tracy/public/TracyClient.cpp:14:
tracy/public/common/TracySystem.cpp:126:5: error: extension used [-Werror,-Wlanguage-extension-token]
    __try
    ^
In file included from tracy/public/TracyClient.cpp:22:
tracy/public/common/tracy_lz4.cpp:445:1: error: extension used [-Werror,-Wlanguage-extension-token]
LZ4_FORCE_INLINE
^
tracy/public/common/tracy_lz4.cpp:132:37: note: expanded from macro 'LZ4_FORCE_INLINE'
#    define LZ4_FORCE_INLINE static __forceinline
                                    ^
wolfpld commented 4 months ago

Please submit your changes to https://github.com/lz4/lz4/

Razakhel commented 4 months ago

Sorry for not getting back to you earlier! The related PR on lz4 has been merged, so this one should be good.