From b009d190bf3c75754391b739c8efd80033d6e133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 28 Dec 2019 18:57:24 +0100 Subject: [PATCH] Avoid detecting Clang as having MSVC's traditional preprocessor Fixes #1806 --- src/catch2/catch_compiler_capabilities.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/catch2/catch_compiler_capabilities.h b/src/catch2/catch_compiler_capabilities.h index 97d08faa..e9a73259 100644 --- a/src/catch2/catch_compiler_capabilities.h +++ b/src/catch2/catch_compiler_capabilities.h @@ -149,9 +149,12 @@ // MSVC traditional preprocessor needs some workaround for __VA_ARGS__ // _MSVC_TRADITIONAL == 0 means new conformant preprocessor // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor -# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) -# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -# endif +# if !defined(__clang__) // Handle Clang masquerading for msvc +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL +# endif // __clang__ + #endif // _MSC_VER #if defined(_REENTRANT) || defined(_MSC_VER)