home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / INCLUDE.ZIP / ASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  580 b   |  31 lines

  1. /*    assert.h
  2.  
  3.     assert macro
  4.  
  5.         Copyright (c) Borland International 1987,1988,1990
  6.     All Rights Reserved.
  7. */
  8.  
  9. #if __STDC__
  10. #define _Cdecl
  11. #else
  12. #define _Cdecl    cdecl
  13. #endif
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. void _Cdecl __assertfail(char *__msg, char *__cond, char *__file, int __line);
  19. #ifdef  __cplusplus
  20. }
  21. #endif
  22.  
  23. #undef assert
  24. #ifdef NDEBUG
  25. #define assert(p)      ((void)0)
  26. #else
  27. #define assert(p)   ((p) ? (void)0 : (void) __assertfail( \
  28.                     "Assertion failed: %s, file %s, line %d\n", \
  29.                     #p, __FILE__, __LINE__ ) )
  30. #endif
  31.