@duhowett hit an issue where the TraceLogging.h header gave issues when compiling with /Zc:preprocessor. Turns out all of the issues were related to using an empty __VA_ARGS__ after a comma, which passes a single empty argument. The fix is to use the ##__VA_ARGS__ compiler extension that all major compilers support now, which will remove the trailing comma if __VA_ARGS__ is empty.
NOTE: It would be more conformant to use __VA_OPT__ for this purpose, however we can't yet assume >= C++20 and forking all of these code paths would be excessive.
Additional note: Looks like we can finally enable -fno-ms-compatibility with Clang, which revealed a couple more issues that have been fixed.
@duhowett hit an issue where the
TraceLogging.h
header gave issues when compiling with/Zc:preprocessor
. Turns out all of the issues were related to using an empty__VA_ARGS__
after a comma, which passes a single empty argument. The fix is to use the##__VA_ARGS__
compiler extension that all major compilers support now, which will remove the trailing comma if__VA_ARGS__
is empty.NOTE: It would be more conformant to use
__VA_OPT__
for this purpose, however we can't yet assume >= C++20 and forking all of these code paths would be excessive.Additional note: Looks like we can finally enable
-fno-ms-compatibility
with Clang, which revealed a couple more issues that have been fixed.