diff --git a/CMakeLists.txt b/CMakeLists.txt index ecee80b9132..f44d1290d1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") endif() endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17 -Wno-attributes -pipe -fvisibility=hidden -Wl,--no-undefined -fnon-call-exceptions") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17 -Wno-attributes -pipe -fvisibility=hidden -Wl,--no-undefined") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") This is for the future versions #set(CMAKE_CXX_STANDARD 14) #Otherwise adds -std=gnu++11 and breaks successful building #set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/src/xrCore/xrDebug.cpp b/src/xrCore/xrDebug.cpp index f53d9db78c3..27c08fac919 100644 --- a/src/xrCore/xrDebug.cpp +++ b/src/xrCore/xrDebug.cpp @@ -670,7 +670,7 @@ void xrDebug::SetupExceptionHandler() #else const auto minidumpFlags = MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory; #endif - + BT_SetDumpType(minidumpFlags); //BT_SetSupportEMail("cop-crash-report@stalker-game.com"); BT_SetSupportEMail("openxray@yahoo.com"); @@ -817,7 +817,7 @@ static void unexpected_handler() { handler_base("unexpected program termination" static void abort_handler(int signal) { handler_base("application is aborting"); } static void floating_point_handler(int signal) { handler_base("floating point error"); } static void illegal_instruction_handler(int signal) { handler_base("illegal instruction"); } -void segmentation_fault_handler(int signal) { throw std::runtime_error("segfault"); } +static void segmentation_fault_handler(int signal) { handler_base("segmentation fault"); } static void termination_handler(int signal) { handler_base("termination with exit code 3"); } void xrDebug::OnThreadSpawn() @@ -843,12 +843,12 @@ void xrDebug::OnThreadSpawn() std::set_unexpected(_terminate); #endif #else //WINDOWS - signal(SIGSEGV, sigsegv_handler); - std::set_terminate(_terminate); signal(SIGABRT, abort_handler); signal(SIGFPE, floating_point_handler); signal(SIGILL, illegal_instruction_handler); signal(SIGINT, 0); + signal(SIGTERM, termination_handler); + signal(SIGSEGV, segmentation_fault_handler); #endif }