home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / ASSERT.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  1KB  |  65 lines

  1. /*  assert.h
  2.  
  3.     assert macro
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 1.5
  9.  *
  10.  *      Copyright (c) 1987, 1994 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15.  
  16. #if !defined(___DEFS_H)
  17. #include <_defs.h>
  18. #endif
  19.  
  20.  
  21. #if !defined(RC_INVOKED)
  22.  
  23. #if defined(__STDC__)
  24. #pragma warn -nak
  25. #endif
  26.  
  27. #endif  /* !RC_INVOKED */
  28.  
  29.  
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. void _RTLENTRY _EXPFUNC _assert(char * __cond, char * __file, int __line);
  36.  
  37. /* Obsolete interface: __msg should be "Assertion failed: %s, file %s, line %d"
  38.  */
  39. void _RTLENTRY _EXPFUNC __assertfail(char * __msg, char * __cond,
  40.                                      char * __file, int __line);
  41.  
  42. #ifdef  __cplusplus
  43. }                                  
  44. #endif
  45.  
  46. #undef assert
  47.  
  48. #ifdef NDEBUG
  49. #define assert(p)   ((void)0)
  50. #else
  51. #define assert(p)   ((p) ? (void)0 : _assert(#p, __FILE__, __LINE__))
  52. #endif
  53.  
  54.  
  55.  
  56.  
  57. #if !defined(RC_INVOKED)
  58.  
  59. #if defined(__STDC__)
  60. #pragma warn .nak
  61. #endif
  62.  
  63. #endif  /* !RC_INVOKED */
  64.  
  65.