From ffa06fbb094e267253832dcdd6773f54634ecc1a Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Mon, 25 Nov 2024 06:21:32 +0000 Subject: [PATCH] 3rdparty/ccc: Make CCC_ASSERT macro call abort instead of exit --- 3rdparty/ccc/src/ccc/util.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/3rdparty/ccc/src/ccc/util.h b/3rdparty/ccc/src/ccc/util.h index be1c3eb4ca..ac27d7e2a0 100644 --- a/3rdparty/ccc/src/ccc/util.h +++ b/3rdparty/ccc/src/ccc/util.h @@ -71,8 +71,15 @@ void set_custom_error_callback(CustomErrorCallback callback); exit(1); \ } +#define CCC_ABORT_IF_FALSE(condition, ...) \ + if (!(condition)) { \ + ccc::Error error = ccc::format_error(__FILE__, __LINE__, __VA_ARGS__); \ + ccc::report_error(error); \ + abort(); \ + } + #define CCC_ASSERT(condition) \ - CCC_CHECK_FATAL(condition, #condition) + CCC_ABORT_IF_FALSE(condition, #condition) // The main error handling construct in CCC. This class is used to bundle // together a return value and a pointer to error information, so that errors