Skip to content

Commit

Permalink
contrib: sync csnippets
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <hexian000@outlook.com>
  • Loading branch information
hexian000 committed Nov 6, 2024
1 parent 59a404c commit 0dfc70c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contrib/csnippets/utils/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,16 @@ int debug_backtrace(void **frames, int calldepth, int len);
} \
} while (0)
#define CHECKMSG(cond, msg) CHECKMSGF(cond, "%s", msg)
#ifdef NDEBUG
#define CHECK(cond) \
do { \
if (!(cond)) { \
FAIL(); \
} \
} while (0)
#else
#define CHECK(cond) CHECKMSGF(cond, "runtime check failed: `%s'", #cond)
#endif

/* ASSERT: an alternative to assert() */
#ifdef NDEBUG
Expand Down

0 comments on commit 0dfc70c

Please sign in to comment.