Source code of Windows XP (NT5)
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.

66 lines
3.6 KiB

  1. #define NOSHELLDEBUG // don't take shell versions of this
  2. // NOTE: You can #define your own DM_* values using bits in the HI BYTE
  3. #define DM_TRACE 0x0001 // Trace messages
  4. #define DM_WARNING 0x0002 // Warning
  5. #define DM_ERROR 0x0004 // Error
  6. #define DM_ASSERT 0x0008 // Assertions
  7. // NOTE: Default debug mask is 0x00ff (show everything)
  8. //
  9. // Inside debugger, you can modify wDebugMask variable.
  10. //
  11. // Set debug mask; returning previous.
  12. //
  13. UINT SetDebugMask(UINT mask);
  14. // Get debug mask.
  15. //
  16. UINT GetDebugMask();
  17. // Use this macro to declare message text that will be placed
  18. // in the CODE segment (useful if DS is getting full)
  19. //
  20. // Ex: DBGTEXT(szMsg, "Invalid whatever: %d");
  21. //
  22. #define DBGTEXT(sz, msg) static const char sz[] = msg;
  23. #ifdef _DEBUG
  24. // Assert(f) -- Generate "assertion failed in line x of file.c"
  25. // message if f is NOT true.
  26. //
  27. // AssertMsg(f, msg, args...) -- Generate wsprintf-formatted msg w/params
  28. // if f is NOT true.
  29. //
  30. // DebugMsg(mask, msg, args...) -
  31. // Generate wsprintf-formatted msg using
  32. // specified debug mask. System debug mask
  33. // governs whether message is output.
  34. //
  35. void AssertFailed(LPCSTR szFile, int line);
  36. #define Assert(f) \
  37. { \
  38. DBGTEXT(szFile, __FILE__); \
  39. if (!(f)) \
  40. AssertFailed(szFile, __LINE__); \
  41. }
  42. #define AssertE(f) Assert(f)
  43. void __cdecl _AssertMsg(BOOL f, LPCSTR pszMsg, ...);
  44. #define AssertMsg _AssertMsg
  45. void __cdecl _DebugMsg(UINT mask, LPCSTR psz, ...);
  46. #define DebugMsg _DebugMsg
  47. #else
  48. // retail versions to produce no code, no data
  49. #define Assert(f)
  50. #define AssertE(f) (f)
  51. #define AssertMsg 1 ? (void)0 : (void)
  52. #define DebugMsg 1 ? (void)0 : (void)
  53. #endif