home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / ASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  647 b   |  34 lines

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