diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index b8f3809dbc..ad752ce390 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -192,6 +192,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if (NOT (MSVC_VERSION LESS 1920)) add_compile_options(/permissive-) endif() + + if (NOT (MSVC_VERSION LESS 1926)) + add_compile_options(/Zc:preprocessor) + endif() endif() else() message("-- Unknown compiler, success is doubtful.") diff --git a/Release/tests/common/UnitTestpp/src/CheckMacros.h b/Release/tests/common/UnitTestpp/src/CheckMacros.h index 43a9cccaf8..a1fd3e2a63 100644 --- a/Release/tests/common/UnitTestpp/src/CheckMacros.h +++ b/Release/tests/common/UnitTestpp/src/CheckMacros.h @@ -94,7 +94,7 @@ #error UnitTest++ redefines VERIFY_IS_NULL #endif -#ifdef WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define VERIFY_IS_TRUE(expression, ...) CHECK_EQUAL(true, expression, __VA_ARGS__) #define VERIFY_IS_FALSE(expression, ...) CHECK_EQUAL(false, expression, __VA_ARGS__) #define VERIFY_ARE_NOT_EQUAL(expected, actual, ...) CHECK_NOT_EQUAL(expected, actual, __VA_ARGS__) @@ -118,7 +118,7 @@ UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \ UNITTEST_MULTILINE_MACRO_END -#ifdef WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define CHECK_EQUAL(expected, actual, ...) \ do \ diff --git a/Release/tests/common/UnitTestpp/src/TestMacros.h b/Release/tests/common/UnitTestpp/src/TestMacros.h index a73b3f1e07..c25879b11a 100644 --- a/Release/tests/common/UnitTestpp/src/TestMacros.h +++ b/Release/tests/common/UnitTestpp/src/TestMacros.h @@ -93,7 +93,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList(); } \ namespace Suite##Name -#ifdef _WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define TEST_EX(Name, List, ...) \ class Test##Name : public UnitTest::Test \ { \ @@ -124,13 +124,13 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList(); void Test##Name::RunImpl() const #endif -#ifdef _WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), __VA_ARGS__) #else #define TEST(Name, ...) TEST_EX(Name, UnitTest::GetTestList(), ##__VA_ARGS__) #endif -#ifdef _WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define TEST_FIXTURE_EX(Fixture, Name, List, ...) \ class Fixture##Name##Helper : public Fixture \ { \ @@ -242,7 +242,7 @@ extern "C" _DLL_EXPORT TestList& __cdecl GetTestList(); void Fixture##Name##Helper::RunImpl() #endif -#ifdef _WIN32 +#if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL #define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), __VA_ARGS__) #else #define TEST_FIXTURE(Fixture, Name, ...) TEST_FIXTURE_EX(Fixture, Name, UnitTest::GetTestList(), ##__VA_ARGS__)