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.

62 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2002.
  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. int CchLoadString(UINT uIdString, WCHAR szBuffer[], int cchBuffer);
  22. #else
  23. //
  24. // Retail code
  25. //
  26. #define DebugCode(x)
  27. #define GarbageInit(pv, cb)
  28. #define CchLoadString(uIdString, szBuffer, cchBuffer) \
  29. ::LoadString(g_hInstance, uIdString, szBuffer, cchBuffer)
  30. #endif
  31. #ifdef DEBUG
  32. /////////////////////////////////////////////
  33. void DoDebugAssert(PCWSTR pszFile, int nLine, PCWSTR pszExpr);
  34. #define Assert(f) if (!(f)) { DoDebugAssert(_T(__FILE__), __LINE__, _T(#f)); } else { }
  35. #define Report(f) Assert(f)
  36. #define Endorse(f) if (f) { } else { }
  37. #define VERIFY(f) Assert(f)
  38. /////////////////////////////////////////////
  39. void DebugTracePrintf(const WCHAR * szFormat, ...);
  40. #define Trace0(sz) DebugTracePrintf(_T("%s"), _T(sz));
  41. #define Trace1(sz, p1) DebugTracePrintf(_T(sz), p1);
  42. #define Trace2(sz, p1, p2) DebugTracePrintf(_T(sz), p1, p2);
  43. #define Trace3(sz, p1, p2, p3) DebugTracePrintf(_T(sz), p1, p2, p3);
  44. #else
  45. #define Assert(f)
  46. #define Report(f)
  47. #define Endorse(f)
  48. #define VERIFY(f) f
  49. #define Trace0(sz)
  50. #define Trace1(sz, p1)
  51. #define Trace2(sz, p1, p2)
  52. #define Trace3(sz, p1, p2, p3)
  53. #endif // ~DEBUG