Empirical
|
A more dynamic replacement for standard library asserts. More...
Go to the source code of this file.
Macros | |
#define | emp_assert(...) |
#define | emp_emscripten_assert(...) emp_assert(__VA_ARGS__) |
A more dynamic replacement for standard library asserts.
A replacement for the system-level assert.h, called "emp_assert" Added functionality:
Example:
int a = 6; emp_assert(a==5, a);
When compiled in debug mode (i.e. without the -DNDEBUG flag), this will trigger an assertion error and print the value of a.
#define emp_assert | ( | ... | ) |
Require a specified condition to be true. If it is false, immediately halt execution. Note: If NDEBUG is defined, emp_assert() will not do anything.
#define emp_emscripten_assert | ( | ... | ) | emp_assert(__VA_ARGS__) |
Require a specified condition to be true if this program was compiled to Javascript with Emscripten. Note: If NDEBUG is defined, emp_emscripten_assert() will not do anything.