From eda38395ddfdeba08c46653b93b8d5bb21f2c863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 23 Aug 2025 19:29:13 -0700 Subject: [PATCH] Made exception handler optional. --- include/bx/debug.h | 3 +++ src/debug.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/bx/debug.h b/include/bx/debug.h index 45e18c6..f5bc37d 100644 --- a/include/bx/debug.h +++ b/include/bx/debug.h @@ -76,6 +76,9 @@ namespace bx /// void debugOutputCallstack(uint32_t _skip); + /// Install BX exception handler. + void installExceptionHandler(); + } // namespace bx #endif // BX_DEBUG_H_HEADER_GUARD diff --git a/src/debug.cpp b/src/debug.cpp index c1f21e9..b1b3b78 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -552,6 +552,16 @@ namespace bx #endif // BX_CONFIG_EXCEPTION_HANDLING_* - ExceptionHandler s_exceptionHandler; + void installExceptionHandler() + { + static bool s_installed = false; + + if (!s_installed) + { + s_installed = true; + + static ExceptionHandler s_exceptionHandler; + } + } } // namespace bx