Commit | Line | Data |
---|---|---|
5a05092d WJ |
1 | /* Allow this file to be included multiple times |
2 | with different settings of NDEBUG. */ | |
3 | #undef assert | |
4 | #undef __assert | |
5 | ||
6 | #ifdef NDEBUG | |
7 | #define assert(ignore) ((void)0) | |
8 | #else | |
9 | ||
10 | void __eprintf (); /* Defined in gnulib */ | |
11 | ||
12 | #ifdef __STDC__ | |
13 | ||
14 | #define assert(expression) \ | |
15 | ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__))) | |
16 | ||
17 | #define __assert(expression, file, lineno) \ | |
18 | (__eprintf ("Failed assertion `%s' at line %d of `%s'.\n", \ | |
19 | expression, lineno, file), 0) | |
20 | ||
21 | #else /* no __STDC__; i.e. -traditional. */ | |
22 | ||
23 | #define assert(expression) \ | |
24 | ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__))) | |
25 | ||
26 | #define __assert(expression, file, lineno) \ | |
27 | (__eprintf ("Failed assertion `%s' at line %d of `%s'.\n", \ | |
28 | "expression", lineno, file), 0) | |
29 | ||
30 | #endif /* no __STDC__; i.e. -traditional. */ | |
31 | ||
32 | #endif |