assert.h 398 B

123456789101112131415161718192021
  1. #ifndef __GBLIBC_ASSERT_H_
  2. #define __GBLIBC_ASSERT_H_
  3. #ifdef NDEBUG
  4. #define assert(st) ((void)(st))
  5. #else
  6. #define assert(st) ((void)((st) || (__assert_fail(#st, __FILE__, __LINE__, __func__), 0)))
  7. #endif
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. void __attribute__((noreturn))
  12. __assert_fail(const char* statement, const char* file, int line, const char* func);
  13. #ifdef __cplusplus
  14. }
  15. #endif
  16. #endif