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

  1. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  2. //=================================================================
  3. //
  4. // AssertBreak.h -- AssertBreak macro definition
  5. //
  6. // Copyright 1997- 1999 Microsoft Corporation
  7. //
  8. // Revisions:    10/15/97    Created
  9. //
  10. //=================================================================
  11.  
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15.  
  16. #ifndef _ASSERT_BREAK_HMH_
  17. #define _ASSERT_BREAK_HMH_
  18.  
  19. #include <stdio.h>
  20.  
  21. // We'll need both of these values in case we're running in NT.
  22. // Since our project is not an NT-only project, these are #ifdefd
  23. // out of windows.h
  24.  
  25. #ifndef _WIN32_WINNT
  26. #define MB_SERVICE_NOTIFICATION          0x00200000L
  27. #define MB_SERVICE_NOTIFICATION_NT3X     0x00040000L
  28. #endif
  29.  
  30. void POLARITY WINAPI assert_break( const char* pszReason, const char* pszFilename, int nLine );
  31.  
  32. #if (defined DEBUG || defined _DEBUG)
  33. #define ASSERT_BREAK(exp)    \
  34.     if (!(exp)) { \
  35.         assert_break( #exp, __FILE__, __LINE__ ); \
  36.     }
  37. #else
  38. #define ASSERT_BREAK(exp)
  39. #endif
  40.  
  41. #endif
  42. #pragma option pop /*P_O_Pop*/
  43.