summaryrefslogtreecommitdiff
path: root/src/libk/include/assert.h
blob: c85d096d18a49dd5c27a6726e1bcdacb366744c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifdef NDEBUG
#define assert(stmt) ((void)0)
#else
#define assert(stmt) (void)((stmt) || (__badassert(__func__, __FILE__, __LINE__),0))
#endif

#ifdef __SPARSE
#undef assert
#define assert(stmt) (0)
#endif

#define static_assert _Static_assert

_Noreturn void __badassert(const char *func, const char *file, int line);