blob: b0dc692cd23a9475fcd96c67dc742e74686e976b [file] [log] [blame]
Rich Felkerc1a96582012-09-07 23:13:55 -04001#include <features.h>
Rich Felker0b44a032011-02-12 00:22:29 -05002
Rich Felkerc1a96582012-09-07 23:13:55 -04003#undef assert
Rich Felker0c05bd32012-09-06 23:34:10 -04004
Rich Felker0b44a032011-02-12 00:22:29 -05005#ifdef NDEBUG
6#define assert(x) (void)0
7#else
8#define assert(x) ((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))
9#endif
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
Rich Felker0c05bd32012-09-06 23:34:10 -040015_Noreturn void __assert_fail (const char *, const char *, int, const char *);
Rich Felker0b44a032011-02-12 00:22:29 -050016
17#ifdef __cplusplus
18}
19#endif