From 5c8242490ec62142d4fa2851f2e9fc37c2d58785 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 1 Jun 2023 23:48:39 -0500 Subject: [PATCH] [ox] Make panic always print message --- deps/ox/src/ox/std/assert.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/ox/src/ox/std/assert.cpp b/deps/ox/src/ox/std/assert.cpp index 2651a83a..32bae40c 100644 --- a/deps/ox/src/ox/std/assert.cpp +++ b/deps/ox/src/ox/std/assert.cpp @@ -13,8 +13,7 @@ namespace ox { -void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]const char *panicMsg, [[maybe_unused]]const Error &err) noexcept { -#ifdef OX_USE_STDLIB +void panic(const char *file, int line, const char *panicMsg, const Error &err) noexcept { oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", file, line, panicMsg); if (err.msg) { oxErrf("\tError Message:\t{}\n", err.msg); @@ -23,6 +22,7 @@ void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_u if (err.file != nullptr) { oxErrf("\tError Location:\t{}:{}\n", err.file, err.line); } +#ifdef OX_USE_STDLIB printStackTrace(2); oxTrace("panic").del("") << "Panic: " << panicMsg << " (" << file << ":" << line << ")"; std::abort();