home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / assert.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  1.3 KB  |  72 lines

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