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.

69 lines
1.6 KiB

  1. /*
  2. * DEBUG.H
  3. *
  4. * Definitions, structures, types, and function prototypes for debugging
  5. * purposes.
  6. *
  7. * Copyright (c)1992 Microsoft Corporation, All Right Reserved,
  8. * as applied to redistribution of this source code in source form
  9. * License is granted to use of compiled code in shipped binaries.
  10. */
  11. #ifndef _DEBUG_H_
  12. #define _DEBUG_H_
  13. #ifdef DEBUG
  14. //Basic debug macros
  15. #define D(x) {x;}
  16. #define ODS(x) D(OutputDebugString(x);OutputDebugString("\r\n"))
  17. #define ODSsz(f, s) {\
  18. char szDebug[128];\
  19. wsprintf(szDebug, f, (LPSTR)s);\
  20. ODS(szDebug);\
  21. }
  22. #define ODSu(f, u) {\
  23. char szDebug[128];\
  24. wsprintf(szDebug, f, (UINT)u);\
  25. ODS(szDebug);\
  26. }
  27. #define ODSlu(f, lu) {\
  28. char szDebug[128];\
  29. wsprintf(szDebug, f, (DWORD)lu);\
  30. ODS(szDebug);\
  31. }
  32. #define ODSszu(f, s, u) {\
  33. char szDebug[128];\
  34. wsprintf(szDebug, f, (LPSTR)s, (UINT)u);\
  35. ODS(szDebug);\
  36. }
  37. #define ODSszlu(f, s, lu) {\
  38. char szDebug[128];\
  39. wsprintf(szDebug, f, (LPSTR)s, (DWORD)lu);\
  40. ODS(szDebug);\
  41. }
  42. #else //NO DEBUG
  43. #define D(x)
  44. #define ODS(x)
  45. #define ODSsz(f, s)
  46. #define ODSu(f, u)
  47. #define ODSlu(f, lu)
  48. #define ODSszu(f, s, u)
  49. #define ODSszlu(f, s, lu)
  50. #endif //DEBUG
  51. #endif //_DEBUG_H_