3rdparty/ccc: Make CCC_ASSERT macro call abort instead of exit

This commit is contained in:
chaoticgd 2024-11-25 06:21:32 +00:00 committed by lightningterror
parent 028e6cd8a8
commit ffa06fbb09
1 changed files with 8 additions and 1 deletions

View File

@ -71,8 +71,15 @@ void set_custom_error_callback(CustomErrorCallback callback);
exit(1); \ 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) \ #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 // 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 // together a return value and a pointer to error information, so that errors