From a530052b7eb2324ed340f9b690f6a6aad7490480 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 16 Mar 2015 18:05:45 -0700 Subject: [PATCH] Only include crtdbg.h when compiling with MSVC --- test/test-main.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test-main.cc b/test/test-main.cc index 036394cd..9f5426ee 100644 --- a/test/test-main.cc +++ b/test/test-main.cc @@ -29,7 +29,13 @@ #ifdef _WIN32 # include +#endif + +#ifdef _MSC_VER # include +#else +# define _CrtSetReportFile(a, b) +# define _CrtSetReportMode(a, b) #endif int main(int argc, char **argv) { @@ -39,12 +45,12 @@ int main(int argc, char **argv) { // doesn't help. SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); +#endif // 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 testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }