home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activedocument / dfv / assert.h < prev    next >
C/C++ Source or Header  |  1997-11-21  |  1KB  |  70 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1992 - 1997 Microsoft Corporation.
  5. //
  6. //  File:       assert.h
  7. //
  8. //  Contents:   private definition of assert, used by NT SDK OLE2 samples
  9. //
  10. //  History:    8-19-94   stevebl   Created
  11. //
  12. //----------------------------------------------------------------------------
  13.  
  14. /*
  15.  * Conditional macro definition for function calling type and variable type
  16.  * qualifiers.
  17.  */
  18. #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  19.  
  20. /*
  21.  * Definitions for MS C8-32 (386/486) compiler
  22.  */
  23. #ifndef _CRTAPI1
  24. #define _CRTAPI1 __cdecl
  25. #endif
  26. #ifndef _CRTAPI2
  27. #define _CRTAPI2 __cdecl
  28. #endif
  29.  
  30. #else
  31.  
  32. /*
  33.  * Other compilers (e.g., MIPS)
  34.  */
  35. #ifndef _CRTAPI1
  36. #define _CRTAPI1
  37. #endif
  38. #ifndef _CRTAPI2
  39. #define _CRTAPI2
  40. #endif
  41.  
  42. #endif
  43.  
  44. #undef  assert
  45.  
  46. #ifdef NDEBUG
  47.  
  48. #define assert(exp)     ((void)0)
  49.  
  50. #else
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. void _CRTAPI1
  56. PopUpAssert(
  57.     void * szFile,
  58.     int iLine,
  59.     void * szMessage);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63.  
  64.  
  65. #define assert(exp) (void)( (exp) || (PopUpAssert(__FILE__, __LINE__, #exp), 0) )
  66. #define _assert(exp, file, line) PopUpAssert(file, line, exp)
  67.  
  68.  
  69. #endif  /* NDEBUG */
  70.