Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright � Microsoft Corporation. All rights reserved.
  4. //
  5. // AssertBreak.h
  6. //
  7. // Purpose: AssertBreak macro definition
  8. //
  9. //***************************************************************************
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #ifndef _ASSERT_BREAK_HMH_
  14. #define _ASSERT_BREAK_HMH_
  15. #include <polarity.h>
  16. // Needed to add L to the __FILE__
  17. #define __FRT2(x) L ## x
  18. #define _FRT2(x) __FRT2(x)
  19. // We'll need both of these values in case we're running in NT.
  20. // Since our project is not an NT-only project, these are #ifdefd
  21. // out of windows.h
  22. #ifndef _WIN32_WINNT
  23. #define MB_SERVICE_NOTIFICATION 0x00200000L
  24. #define MB_SERVICE_NOTIFICATION_NT3X 0x00040000L
  25. #endif
  26. void POLARITY WINAPI assert_break( LPCWSTR pszReason, LPCWSTR pszFilename, int nLine );
  27. #if (defined DEBUG || defined _DEBUG)
  28. #define ASSERT_BREAK(exp) \
  29. if (!(exp)) { \
  30. assert_break( _FRT2(#exp), _FRT2(__FILE__), __LINE__ ); \
  31. }
  32. #else
  33. #define ASSERT_BREAK(exp)
  34. #endif
  35. #endif