I run cl /P test.cpp, the file and result is as following.
test.cpp
#define FiltedLog( ...) \\
if (logDetail) \\
MP_LOG(LOG_INFO, __VA_ARGS_
Yes, this is a longstanding bug in the Visual C++ preprocessor. To work around it, use indirection:
#define INDIRECT_EXPAND(m, args) m args
#define FiltedLog( ...) \
if (logDetail) \
INDIRECT_EXPAND(MP_LOG, (LOG_INFO, __VA_ARGS__));
(Do note that __PRETTY_FUNCTION__
is a nonstandard extension that is not supported by Visual C++.)