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.

68 lines
1.2 KiB

  1. /****************************************************************************/
  2. // trace.h
  3. //
  4. // Tracing definitions. See trace.c for other information.
  5. //
  6. // Copyright (C) 1999-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #if DBG || defined(_DEBUG)
  12. #include <stdio.h>
  13. // Zones. Up to 32 zones can be defined, these are predefined for general use.
  14. #define Z_ASSERT 0x01
  15. #define Z_ERR 0x02
  16. #define Z_WRN 0x04
  17. #define Z_TRC1 0x08
  18. #define Z_TRC2 0x10
  19. // Defined in msmcs.c.
  20. extern char TB[1024];
  21. extern UINT32 g_TraceMask;
  22. void TracePrintZ(UINT32, char *);
  23. // Error, warning, trace level 1, and trace level 2 definitions.
  24. #define ERR(X) TRCZ(Z_ERR, X)
  25. #define WRN(X) TRCZ(Z_WRN, X)
  26. #define TRC1(X) TRCZ(Z_TRC1, X)
  27. #define TRC2(X) TRCZ(Z_TRC2, X)
  28. #define ASSERT(COND, X) \
  29. { \
  30. if (!(COND)) { \
  31. TRCZ(Z_ASSERT, X); \
  32. DebugBreak(); \
  33. } \
  34. }
  35. #define TRCZ(Z, X) \
  36. { \
  37. if (g_TraceMask & (Z)) { \
  38. sprintf X; \
  39. TracePrintZ((Z), TB); \
  40. } \
  41. }
  42. #else // DBG
  43. #define ERR(X)
  44. #define WRN(X)
  45. #define TRC1(X)
  46. #define TRC2(X)
  47. #define ASSERT(COND, X)
  48. #endif // DBG
  49. #ifdef __cplusplus
  50. }
  51. #endif