summaryrefslogtreecommitdiff
path: root/src/libk/include/assert.h
blob: affe1dcaf7f9d766eb7ca3dadf6d7e9da198970b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#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

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