Skip to content

Commit

Permalink
3rdparty/ccc: Make CCC_ASSERT macro call abort instead of exit
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd authored and lightningterror committed Nov 27, 2024
1 parent 028e6cd commit ffa06fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 3rdparty/ccc/src/ccc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ffa06fb

Please sign in to comment.