Commit b47a66bd authored by npzacs's avatar npzacs

macro: add assertion macros

parent ff2eca11
......@@ -32,4 +32,14 @@
#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1))
# define BD_ASSERT(p) \
do { \
if (!(p)) { \
BD_DEBUG(DBG_CRIT, "assertion failed: '%s'\n", #p); \
} \
} while (0)
# define BD_ASSERT_UNREACHABLE(m) \
BD_DEBUG(DBG_CRIT, "assertion failed: '%s'\n", m)
#endif /* MACRO_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment