home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 10.ddi / 017.LIF / ASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-02  |  582 b   |  32 lines

  1. /* assert.h - define the assert macro
  2.  * $Version: 1.1 $
  3.  * Copyright (c) 1984, 85 Computer Innovations Inc, ALL RIGHTS RESERVED.
  4.  * Copyright (c) 1988, 89 Intel Corporation, ALL RIGHTS RESERVED.
  5.  */
  6.  
  7. #undef assert
  8.  
  9. #ifndef NDEBUG
  10.  
  11. #ifndef _stdioh 
  12. #include <stdio.h>
  13. #endif
  14. #ifndef _stdlibh
  15. #include <stdlib.h>
  16. #endif
  17.  
  18. #define assert(_exp_) { \
  19.   if (!(_exp_)) { \
  20.     fprintf(stderr, "Assertion failed: %s, file %s, line %d\n", \
  21.             #_exp_, __FILE__, __LINE__); \
  22.     abort(); \
  23.   } \
  24. }
  25.  
  26. #else
  27.  
  28. #define assert(ignore)
  29.  
  30. #endif /* NDEBUG */
  31.  
  32.