home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / assert.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-28  |  359 b   |  20 lines

  1. /* 
  2.  * @(#)assert.h XdLibs, SozobonX
  3.  * 
  4.  * 
  5.  */
  6.  
  7. #ifndef _ASSERT_H
  8. #define    _ASSERT_H
  9.  
  10. #ifdef NDEBUG
  11. #define    assert(cond)
  12. #else
  13. #include <stdio.h>
  14. static char __AssertFmt[] = "assert failed in '%s' at line %d.\n";
  15. #define    assert(cond)    if(!(cond)) \
  16.  { fprintf(stderr, __AssertFmt, __FILE__, __LINE__); exit(-1); }
  17. #endif /* NDEBUG */
  18.  
  19. #endif     /* _ASSERT_H    */
  20.