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.

74 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. wtdebug.h
  5. Abstract:
  6. Contains debug related definitions.
  7. Environment:
  8. User mode
  9. Author:
  10. Michael Tsang (MikeTs) 13-Mar-2000
  11. Revision History:
  12. --*/
  13. #ifndef _WTDEBUG_H
  14. #define _WTDEBUG_H
  15. //
  16. // Macros
  17. //
  18. #ifdef WTDEBUG
  19. #define WTASSERT(x) if (!(x)) \
  20. { \
  21. WTDebugPrint("Assertion failed in file " \
  22. "%s at line %d\n", \
  23. __FILE__, __LINE__); \
  24. }
  25. #define WTDBGPRINT(n,x) if ((n) <= giWTVerboseLevel) \
  26. { \
  27. WTDebugPrint(MODNAME ": %s: ", ProcName); \
  28. WTDebugPrint x; \
  29. }
  30. #define WTWARNPRINT(x) { \
  31. WTDebugPrint(MODNAME "_WARN: %s: ", \
  32. ProcName); \
  33. WTDebugPrint x; \
  34. }
  35. #define WTERRPRINT(x) { \
  36. WTDebugPrint(MODNAME "_ERR: %s: ", \
  37. ProcName); \
  38. WTDebugPrint x; \
  39. DebugBreak(); \
  40. }
  41. #else
  42. #define WTASSERT(x)
  43. #define WTDBGPRINT(n,x)
  44. #define WTWARNPRINT(x)
  45. #define WTERRPRINT(x)
  46. #endif //ifdef WTDEBUG
  47. //
  48. // Exported Data Declarations
  49. //
  50. extern int giWTVerboseLevel;
  51. //
  52. // Exported Function prototypes
  53. //
  54. #ifdef WTDEBUG
  55. int LOCAL
  56. WTDebugPrint(
  57. IN LPCSTR format,
  58. ...
  59. );
  60. #endif //ifdef WTDEBUG
  61. #endif //ifndef _WTDEBUG_H