From fc7dada764aefb825690c06e53a5d6fb4c078e8c Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 2 Jan 2021 07:52:50 -0500 Subject: [PATCH] - sync from gzdoom --- source/CMakeLists.txt | 1 + source/common/platform/win32/i_crash_arm.cpp | 7 +++++++ source/common/platform/win32/i_main.cpp | 12 ++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 source/common/platform/win32/i_crash_arm.cpp diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index f99ff0c78..e11797d52 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -508,6 +508,7 @@ if (NOT ${TARGET_ARCHITECTURE} MATCHES "arm" ) set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/i_crash.cpp ) endif() if (MSVC AND ${TARGET_ARCHITECTURE} MATCHES "arm") + set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/i_crash_arm.cpp ) add_definitions( -DNO_SSE -D__ARM__ -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN) endif() diff --git a/source/common/platform/win32/i_crash_arm.cpp b/source/common/platform/win32/i_crash_arm.cpp new file mode 100644 index 000000000..2a61ab42c --- /dev/null +++ b/source/common/platform/win32/i_crash_arm.cpp @@ -0,0 +1,7 @@ +// Licensed to the Public Domain by Rachael Alexandersion (c) 2021 +// This file is nothing more than a stub. Please replace with a proper copyright notice if this function is implemented for ARM. Or just use the regular i_crash.cpp + +void DisplayCrashLog() +{ + // stub +} diff --git a/source/common/platform/win32/i_main.cpp b/source/common/platform/win32/i_main.cpp index 1d59244c2..7207717ea 100644 --- a/source/common/platform/win32/i_main.cpp +++ b/source/common/platform/win32/i_main.cpp @@ -1076,9 +1076,7 @@ void CALLBACK ExitFatally (ULONG_PTR dummy) SetUnhandledExceptionFilter (ExitMessedUp); I_ShutdownGraphics (); RestoreConView (); -#ifndef _M_ARM64 DisplayCrashLog (); -#endif exit(-1); } @@ -1135,6 +1133,12 @@ LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info) } return EXCEPTION_CONTINUE_EXECUTION; } +#else // !_M_ARM64 +// stub this function for ARM64 +LONG WINAPI CatchAllExceptions (LPEXCEPTION_POINTERS info) +{ + return EXCEPTION_CONTINUE_EXECUTION; +} #endif // !_M_ARM64 //========================================================================== @@ -1159,11 +1163,7 @@ static void infiniterecursion(int foo) // which offers the very important feature to open a debugger and see the crash in context right away. CUSTOM_CVAR(Bool, disablecrashlog, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { -#ifndef _M_ARM64 SetUnhandledExceptionFilter(!*self ? CatchAllExceptions : nullptr); -#else - SetUnhandledExceptionFilter(nullptr); -#endif } //==========================================================================