assert: Split some of the work into a separate C file.
[libcstd.git] / include / assert.h
blob558a6b66dc72c02b06dcb92c01ac6d2d81377456
1 #ifndef _ASSERT_H_
2 #define _ASSERT_H_
4 static inline void
5 assert(const char *file, unsigned line, const char *func,
6 _Bool failed, const char *expr)
8 void _assert(const char *, unsigned, const char *, const char *);
10 if (failed)
11 _assert(file, line, func, expr);
14 #endif
16 #undef assert
17 #ifdef NDEBUG
18 # define assert(expr) ((void)0)
19 #else
20 # define assert(expr) assert(__FILE__, __LINE__, __func__, \
21 0 == (expr), #expr)
22 #endif