From e49429051272141a91ce898caa176f4366c5209e Mon Sep 17 00:00:00 2001 From: Tanzinul Islam Date: Mon, 19 Jun 2017 01:33:58 +0100 Subject: [PATCH] Allow death test child to bypass WER under MinGW The mechanics of suppressing debugger trapping and Windows Error Reporting for the crashed child process in a death test are currently guarded under the `GTEST_HAS_SEH` macro. This seems unnecessary, as the logic does not call any APIs related to Structured Error Handling. Replace the guarding macro with the more permissive `GTEST_OS_WINDOWS`, so that Windows toolchains without SEH support (e.g. MinGW) can benefit from it. Fixes: #1116 --- googletest/src/gtest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 3a18f25d..dc5f54d8 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -4214,7 +4214,7 @@ int UnitTest::Run() { // used for the duration of the program. impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions)); -#if GTEST_HAS_SEH +#if GTEST_OS_WINDOWS // Either the user wants Google Test to catch exceptions thrown by the // tests or this is executing in the context of death test child // process. In either case the user does not want to see pop-up dialogs @@ -4251,7 +4251,7 @@ int UnitTest::Run() { _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump. # endif } -#endif // GTEST_HAS_SEH +#endif // GTEST_OS_WINDOWS return internal::HandleExceptionsInMethodIfSupported( impl(),