Since we now only support Visual Studio 2019 16.7 and newer, we're able to use the /Zc:preprocessor flag that turns on the standards-conforming preprocessor. Among other things, it correctly expands __VA_ARGS__. This enables removal of some boilerplate in D135128.
Reviewed By: Bigcheese, thieta
Differential Revision: https://reviews.llvm.org/D135128
append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ # Enable standards-conforming preprocessor.
+ # https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor
+ append("/Zc:preprocessor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
# Some projects use the __cplusplus preprocessor macro to check support for
# a particular version of the C++ standard. When this option is not specified
# explicitly, macro's value is "199711L" that implies C++98 Standard.