assert.h 501 B

1234567891011121314151617181920212223
  1. #ifndef __ASSERT_H
  2. #define __ASSERT_H
  3. #include <features.h>
  4. /* If NDEBUG is defined, do nothing.
  5. If not, and EXPRESSION is zero, print an error message and abort. */
  6. #ifdef NDEBUG
  7. #define assert(expr) ((void) 0)
  8. #else /* Not NDEBUG. */
  9. extern void __assert __P((const char *, const char *, int));
  10. #define assert(expr) \
  11. ((void) ((expr) || \
  12. (__assert (__STRING(expr), \
  13. __FILE__, __LINE__), 0)))
  14. #endif /* NDEBUG. */
  15. #endif /* __ASSERT_H */