[util] better ASSERT macro

This commit is contained in:
Milo Turner 2020-02-08 08:46:05 -05:00
parent 8f6ab23830
commit dfa3c39cec
1 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,10 @@
#define ASSERT(_cond, ...) do { \
if (!(_cond)) { \
fprintf(stderr, "ASSERT FAILED:\n" __VA_ARGS__); \
fprintf(stderr, "%s:%d: assertion failed:\n", \
__FILE__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
exit(1); \
} \
} while (0)