[util] UNIMPLEMENTED() macro

This commit is contained in:
Milo Turner 2020-02-08 08:37:27 -05:00
parent efd832a3bd
commit 35df16af8b
1 changed files with 4 additions and 0 deletions

View File

@ -5,8 +5,12 @@
#define ASSERT(_cond, ...) do { \
if (!(_cond)) { \
fprintf(stderr, "ASSERT FAILED:\n" __VA_ARGS__); \
exit(1); \
} \
} while (0)
#define ASSERT_NON_NULL(_ptr, _who) \
ASSERT((_ptr) != NULL, "`" _who "' should not be null")
#define UNIMPLEMENTED() \
ASSERT(0, "not implemented")