home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / ASSERT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.6 KB  |  82 lines

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