assertion.h 242 B

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