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.

42 lines
1.1 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  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. // Needed to add L to the __FILE__
  16. #define __FRT2(x) L ## x
  17. #define _FRT2(x) __FRT2(x)
  18. // We'll need both of these values in case we're running in NT.
  19. // Since our project is not an NT-only project, these are #ifdefd
  20. // out of windows.h
  21. #ifndef _WIN32_WINNT
  22. #define MB_SERVICE_NOTIFICATION 0x00200000L
  23. #define MB_SERVICE_NOTIFICATION_NT3X 0x00040000L
  24. #endif
  25. void WINAPI assert_break( LPCWSTR pszReason, LPCWSTR pszFilename, int nLine );
  26. #if (defined DEBUG || defined _DEBUG)
  27. #define ASSERT_BREAK(exp) \
  28. if (!(exp)) { \
  29. assert_break( _FRT2(#exp), _FRT2(__FILE__), __LINE__ ); \
  30. }
  31. #else
  32. #define ASSERT_BREAK(exp)
  33. #endif
  34. #endif