[util] UNIMPLEMENTED() macro
This commit is contained in:
parent
efd832a3bd
commit
35df16af8b
|
@ -5,8 +5,12 @@
|
||||||
#define ASSERT(_cond, ...) do { \
|
#define ASSERT(_cond, ...) do { \
|
||||||
if (!(_cond)) { \
|
if (!(_cond)) { \
|
||||||
fprintf(stderr, "ASSERT FAILED:\n" __VA_ARGS__); \
|
fprintf(stderr, "ASSERT FAILED:\n" __VA_ARGS__); \
|
||||||
|
exit(1); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define ASSERT_NON_NULL(_ptr, _who) \
|
#define ASSERT_NON_NULL(_ptr, _who) \
|
||||||
ASSERT((_ptr) != NULL, "`" _who "' should not be null")
|
ASSERT((_ptr) != NULL, "`" _who "' should not be null")
|
||||||
|
|
||||||
|
#define UNIMPLEMENTED() \
|
||||||
|
ASSERT(0, "not implemented")
|
||||||
|
|
Loading…
Reference in New Issue