assert.h 428 B

1234567891011121314151617181920212223
  1. #include <features.h>
  2. #undef assert
  3. #ifdef NDEBUG
  4. #define assert(x) (void)0
  5. #else
  6. #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
  7. #endif
  8. #if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
  9. #define static_assert _Static_assert
  10. #endif
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. _Noreturn void __assert_fail (const char *, const char *, int, const char *);
  15. #ifdef __cplusplus
  16. }
  17. #endif