From 9fb9eb4fd2881a08b3acb6916ec0d998c4dfee27 Mon Sep 17 00:00:00 2001 From: Reece Date: Thu, 16 Jun 2022 01:58:29 +0100 Subject: [PATCH] [*] Amend panic --- Source/Debug/Panic.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Debug/Panic.cpp b/Source/Debug/Panic.cpp index a10472c4..b06c5052 100644 --- a/Source/Debug/Panic.cpp +++ b/Source/Debug/Panic.cpp @@ -26,7 +26,7 @@ namespace Aurora::Debug { ::DebugBreak(); } - #elif defined(DEBUG) + #elif defined(AU_CFG_ID_DEBUG) // bc nix #if defined(AURORA_COMPILER_MSVC) __debugbreak(); #elif (defined(__has_builtin) && __has_builtin(__builtin_debugtrap)) @@ -52,9 +52,12 @@ namespace Aurora::Debug goto failFast; } - #if defined(AU_CFG_ID_DEBUG) DebugBreak(); + // Edge case: internal builds should always check for a debugger before crashing + #if defined(AU_CFG_ID_INTERNAL) && (defined(__has_builtin) && __has_builtin(__builtin_debugtrap)) + __builtin_debugtrap(); #endif + // if (AuExchange(gHandlingFatal, true)) {