home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 2.ddi / INCLUDE.ZIP / ASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-13  |  803 b   |  43 lines

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