Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 1 | #include <features.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 2 | |
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 3 | #undef assert |
Rich Felker | 0c05bd3 | 2012-09-06 23:34:10 -0400 | [diff] [blame] | 4 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 5 | #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 |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
Rich Felker | 0c05bd3 | 2012-09-06 23:34:10 -0400 | [diff] [blame] | 15 | _Noreturn void __assert_fail (const char *, const char *, int, const char *); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 16 | |
| 17 | #ifdef __cplusplus |
| 18 | } |
| 19 | #endif |