1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifdef _ASSERT_H
- # undef _ASSERT_H
- # undef assert
- # undef __ASSERT_VOID_CAST
- #endif
- #define _ASSERT_H 1
- #include <features.h>
- #if defined __cplusplus && __GNUC_PREREQ (2,95)
- # define __ASSERT_VOID_CAST static_cast<void>
- #else
- # define __ASSERT_VOID_CAST (void)
- #endif
- #ifdef NDEBUG
- # define assert(expr) (__ASSERT_VOID_CAST (0))
- #else
- __BEGIN_DECLS
- extern void __assert(const char *, const char *, unsigned int, const char *)
- __THROW __attribute__ ((__noreturn__));
- libc_hidden_proto(__assert)
- __END_DECLS
- # define assert(expr) \
- (__ASSERT_VOID_CAST ((expr) ? 0 : \
- (__assert (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
- # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
- # define __ASSERT_FUNCTION __func__
- # else
- # define __ASSERT_FUNCTION ((const char *) 0)
- # endif
- # endif
- #endif
- #if defined __USE_ISOC11 && !defined __cplusplus
- # undef static_assert
- # define static_assert _Static_assert
- #endif
|