12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef __ASSERT_H
- #define __ASSERT_H
- #include <features.h>
- #ifdef NDEBUG
- #define assert(expr) ((void) 0)
- #else
- __BEGIN_DECLS
- extern void __assert __P((const char *, const char *, int, const char *));
- __END_DECLS
- #define assert(expr) \
- ((void) ((expr) || \
- (__assert (__STRING(expr), \
- __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
-
- # ifdef __GNUC__
- # if __GNUC__ > 2 || (__GNUC__ == 2 \
- && __GNUC_MINOR__ >= (defined __cplusplus ? 6 : 4))
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # define __ASSERT_FUNCTION ((__const char *) 0)
- # endif
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
- # define __ASSERT_FUNCTION __func__
- # else
- # define __ASSERT_FUNCTION ((__const char *) 0)
- # endif
- # endif
- #endif
- #endif
|