assert.h 581 B

1234567891011121314151617
  1. /* $Header$ */
  2. /* A S S E R T I O N M A C R O D E F I N I T I O N */
  3. /* At some points in the program, it must be sure that some condition
  4. holds true, due to further, successful, processing. As long as
  5. there is no reasonable method to prove that a program is 100%
  6. correct, these assertions are needed in some places.
  7. */
  8. #include "debug.h" /* UF */
  9. #ifdef DEBUG
  10. /* Note: this macro uses parameter substitution inside strings */
  11. #define ASSERT(exp) (exp || crash("in %s, %u: assertion %s failed", \
  12. __FILE__, __LINE__, "exp"))
  13. #else
  14. #define ASSERT(exp)
  15. #endif DEBUG