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

  1. /*  assert.h
  2.  
  3.     assert macro
  4.  
  5.     Copyright (c) 1987, 1992 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 _FARFUNC __assertfail( char _FAR *__msg,
  18.                                    char _FAR *__cond,
  19.                                    char _FAR *__file,
  20.                                    int __line);
  21.  
  22. #ifdef  __cplusplus
  23. }
  24. #endif
  25.  
  26. #undef assert
  27.  
  28. #ifdef NDEBUG
  29. #  define assert(p)   ((void)0)
  30. #else
  31. #  ifdef _Windows
  32. #    define _ENDL
  33. #  else
  34. #    define _ENDL "\n"
  35. #  endif
  36. #  define assert(p) ((p) ? (void)0 : (void) __assertfail( \
  37.                     "Assertion failed: %s, file %s, line %d" _ENDL, \
  38.                     #p, __FILE__, __LINE__ ) )
  39. #endif
  40.