home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / bloodshed / devcpp-4.9.9.2_setup.exe / assert.h < prev    next >
C/C++ Source or Header  |  2005-01-29  |  994b  |  56 lines

  1. /* 
  2.  * assert.h
  3.  * This file has no copyright assigned and is placed in the Public Domain.
  4.  * This file is a part of the mingw-runtime package.
  5.  * No warranty is given; refer to the file DISCLAIMER within the package.
  6.  *
  7.  * Define the assert macro for debug output.
  8.  *
  9.  */
  10.  
  11. #ifndef _ASSERT_H_
  12. #define    _ASSERT_H_
  13.  
  14. /* All the headers include this file. */
  15. #include <_mingw.h>
  16.  
  17. #ifndef RC_INVOKED
  18.  
  19. #ifdef    __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. #ifdef NDEBUG
  24.  
  25. /*
  26.  * If not debugging, assert does nothing.
  27.  */
  28. #define assert(x)    ((void)0)
  29.  
  30. #else /* debugging enabled */
  31.  
  32. /*
  33.  * CRTDLL nicely supplies a function which does the actual output and
  34.  * call to abort.
  35.  */
  36. _CRTIMP void __cdecl _assert (const char*, const char*, int)
  37. #ifdef    __GNUC__
  38.     __attribute__ ((noreturn))
  39. #endif
  40.     ;
  41.  
  42. /*
  43.  * Definition of the assert macro.
  44.  */
  45. #define assert(e)       ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
  46. #endif    /* NDEBUG */
  47.  
  48. #ifdef    __cplusplus
  49. }
  50. #endif
  51.  
  52. #endif /* Not RC_INVOKED */
  53.  
  54. #endif /* Not _ASSERT_H_ */
  55.  
  56.