home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 4.ddi / INCLUDE / ASSERT.H$ / ASSERT
Encoding:
Text File  |  1991-11-06  |  588 b   |  36 lines

  1. /***
  2. *assert.h - define the assert macro
  3. *
  4. *    Copyright (c) 1985-1992, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *    Defines the assert(exp) macro.
  8. *    [ANSI/System V]
  9. *
  10. ****/
  11.  
  12. #if (_MSC_VER <= 600)
  13. #define __cdecl     _cdecl
  14. #define __far       _far
  15. #endif
  16.  
  17. #undef    assert
  18.  
  19. #ifdef NDEBUG
  20.  
  21. #define assert(exp)    ((void)0)
  22.  
  23. #else
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. void __cdecl _assert(void *, void *, unsigned);
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31.  
  32. #define assert(exp) \
  33.     ( (exp) ? (void) 0 : _assert(#exp, __FILE__, __LINE__) )
  34.  
  35. #endif /* NDEBUG */
  36.