1 /* Allow this file to be included multiple times
2 with different settings of NDEBUG. */
7 #define assert(ignore) ((void) 0)
12 #define assert(expression) \
13 ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
15 #define __assert(expression, file, lineno) \
16 (printf ("%s:%u: failed assertion\n", file, lineno), \
21 #if defined(__STDC__) || defined (__cplusplus)
23 /* Defined in libgcc.a */
26 extern void __eprintf (const char *, const char *, unsigned, const char *)
27 __attribute__ ((noreturn
));
30 extern void __eprintf (const char *, const char *, unsigned, const char *)
31 __attribute__ ((noreturn
));
34 #define assert(expression) \
35 ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
37 #define __assert(expression, file, line) \
38 (__eprintf ("%s:%u: failed assertion `%s'\n", \
39 file, line, expression), 0)
41 #else /* no __STDC__ and not C++; i.e. -traditional. */
43 extern void __eprintf () __attribute__ ((noreturn
)); /* Defined in libgcc.a */
45 #define assert(expression) \
46 ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
48 #define __assert(expression, file, lineno) \
49 (__eprintf ("%s:%u: failed assertion `%s'\n", \
50 file, lineno, "expression"), 0)
52 #endif /* no __STDC__ and not C++; i.e. -traditional. */
53 #endif /* no __GNU__; i.e., /bin/cc. */