5 /* If NDEBUG is defined, do nothing.
6 If not, and EXPRESSION is zero, print an error message and abort. */
10 #define assert(expr) ((void) 0)
12 #else /* Not NDEBUG. */
14 extern void __assert __P((const char *, const char *, int, const char *));
16 #define assert(expr) \
18 (__assert (__STRING(expr), \
19 __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
22 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
23 which contains the name of the function currently being defined.
24 # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
25 This is broken in G++ before version 2.6.
26 C9x has a similar variable called __func__, but prefer the GCC one since
27 it demangles C++ function names. */
29 # if __GNUC__ > 2 || (__GNUC__ == 2 \
30 && __GNUC_MINOR__ >= (defined __cplusplus ? 6 : 4))
31 # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
33 # define __ASSERT_FUNCTION ((__const char *) 0)
36 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
37 # define __ASSERT_FUNCTION __func__
39 # define __ASSERT_FUNCTION ((__const char *) 0)
46 #endif /* __ASSERT_H */