home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c045 / 2.ddi / INCLUDE / ASSERT.H$ / ASSERT.bin
Encoding:
Text File  |  1992-01-01  |  785 b   |  47 lines

  1. /***
  2. *assert.h - define the assert macro
  3. *
  4. *    Copyright (c) 1985-1991, Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *    Defines the assert(exp) macro.
  8. *    [ANSI/System V]
  9. *
  10. ****/
  11.  
  12. #if defined(_DLL) && !defined(_MT)
  13. #error Cannot define _DLL without _MT
  14. #endif
  15.  
  16. #ifdef _MT
  17. #define _FAR_ __far
  18. #else
  19. #define _FAR_
  20. #endif
  21.  
  22. #if (_MSC_VER <= 600)
  23. #define __cdecl     _cdecl
  24. #define __far       _far
  25. #define __loadds    _loadds
  26. #endif
  27.  
  28. #undef    assert
  29.  
  30. #ifdef NDEBUG
  31.  
  32. #define assert(exp)    ((void)0)
  33.  
  34. #else
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. void _FAR_ __cdecl _assert(void _FAR_ *, void _FAR_ *, unsigned);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42.  
  43. #define assert(exp) \
  44.     ( (exp) ? (void) 0 : _assert(#exp, __FILE__, __LINE__) )
  45.  
  46. #endif /* NDEBUG */
  47.