[util] better ASSERT macro
This commit is contained in:
parent
8f6ab23830
commit
dfa3c39cec
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue