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.

63 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: debug.h
  7. //
  8. // Contents:
  9. //
  10. //----------------------------------------------------------------------------
  11. // Debug.h
  12. //
  13. #ifdef _DEBUG
  14. #define DEBUG
  15. #endif
  16. #ifdef DEBUG
  17. //
  18. // Debug code
  19. //
  20. #define DebugCode(x) x
  21. #define GarbageInit(pv, cb) memset(pv, 'a', cb)
  22. int CchLoadString(UINT uIdString, TCHAR szBuffer[], int cchBuffer);
  23. #else
  24. //
  25. // Retail code
  26. //
  27. #define DebugCode(x)
  28. #define GarbageInit(pv, cb)
  29. #define CchLoadString(uIdString, szBuffer, cchBuffer) \
  30. ::LoadString(g_hInstance, uIdString, szBuffer, cchBuffer)
  31. #endif
  32. #ifdef DEBUG
  33. /////////////////////////////////////////////
  34. void DoDebugAssert(LPCTSTR pszFile, int nLine, LPCTSTR pszExpr);
  35. #define Assert(f) if (!(f)) { DoDebugAssert(_T(__FILE__), __LINE__, _T(#f)); } else { }
  36. #define Report(f) Assert(f)
  37. #define Endorse(f) if (f) { } else { }
  38. #define VERIFY(f) Assert(f)
  39. /////////////////////////////////////////////
  40. void DebugTracePrintf(const TCHAR * szFormat, ...);
  41. #define Trace0(sz) DebugTracePrintf(_T("%s"), _T(sz));
  42. #define Trace1(sz, p1) DebugTracePrintf(_T(sz), p1);
  43. #define Trace2(sz, p1, p2) DebugTracePrintf(_T(sz), p1, p2);
  44. #define Trace3(sz, p1, p2, p3) DebugTracePrintf(_T(sz), p1, p2, p3);
  45. #else
  46. #define Assert(f)
  47. #define Report(f)
  48. #define Endorse(f)
  49. #define VERIFY(f) f
  50. #define Trace0(sz)
  51. #define Trace1(sz, p1)
  52. #define Trace2(sz, p1, p2)
  53. #define Trace3(sz, p1, p2, p3)
  54. #endif // ~DEBUG