assert.h 273 B

1234567891011121314
  1. #ifndef _ASSERT_H
  2. #define _ASSERT_H
  3. #ifdef NDEBUG
  4. # define assert(cond)
  5. #else
  6. # include <stdio.h>
  7. # define assert(cond) if (!(cond)) { \
  8. fprintf(stderr, "%s: %s:%d: Assertion `%s` failed.\n", __func__, __FILE__, __LINE__, #cond); \
  9. abort(); \
  10. }
  11. #endif
  12. #endif