Describe what check() and expect() are
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
eb35abfa52
commit
da805eec83
@ -7,6 +7,7 @@
|
|||||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Like check(), but with a custom error message.
|
||||||
#define expect(expr, message) \
|
#define expect(expr, message) \
|
||||||
do { \
|
do { \
|
||||||
if (!(expr)) [[unlikely]] \
|
if (!(expr)) [[unlikely]] \
|
||||||
@ -15,6 +16,7 @@
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
// Like assert(), but always enabled.
|
||||||
#define check(expr) \
|
#define check(expr) \
|
||||||
do { \
|
do { \
|
||||||
if (!(expr)) [[unlikely]] \
|
if (!(expr)) [[unlikely]] \
|
||||||
|
Loading…
Reference in New Issue
Block a user