diff --git a/test/posix-mock-test.cc b/test/posix-mock-test.cc index 8a2214e8..32adbd50 100644 --- a/test/posix-mock-test.cc +++ b/test/posix-mock-test.cc @@ -6,7 +6,7 @@ // For the license information refer to format.h. // Disable bogus MSVC warnings. -#ifndef _CRT_SECURE_NO_WARNINGS +#if !defined(_CRT_SECURE_NO_WARNINGS) && defined(_MSC_VER) # define _CRT_SECURE_NO_WARNINGS #endif diff --git a/test/test-main.cc b/test/test-main.cc index 268ed086..39d2789d 100644 --- a/test/test-main.cc +++ b/test/test-main.cc @@ -15,9 +15,6 @@ #ifdef _MSC_VER # include -#else -# define _CrtSetReportFile(a, b) -# define _CrtSetReportMode(a, b) #endif int main(int argc, char** argv) { @@ -28,11 +25,13 @@ int main(int argc, char** argv) { SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); #endif +#ifdef _MSC_VER // Disable message boxes on assertion failures. _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); +#endif try { testing::InitGoogleTest(&argc, argv); testing::FLAGS_gtest_death_test_style = "threadsafe";