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.

89 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999-2000.
  5. //
  6. // File: debug.h
  7. //
  8. // Contents: Debugging macros and prototypes
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef _DEBUG_H_
  12. #define _DEBUG_H_
  13. #if DBG == 1
  14. void _TRACE (int level, const wchar_t *format, ... );
  15. void TRACE (const wchar_t *format, ... );
  16. //
  17. // External functions
  18. //
  19. PCSTR StripDirPrefixA(PCSTR);
  20. //
  21. // These macros are used for asserting certain conditions. They are
  22. // independent of the debugging level.
  23. // These also require additional paranthesis to enclose the msg as
  24. // shown below.
  25. //
  26. #ifdef ASSERT
  27. #undef ASSERT
  28. #undef ASSERTMSG
  29. #endif
  30. #define ASSERT(expr) \
  31. { \
  32. if (!(expr)) \
  33. { \
  34. _TRACE (0, L"ACLDiag(Thread ID: %d): Assert: %s(%u)\n", \
  35. GetCurrentThreadId(), \
  36. StripDirPrefixA(__FILE__), __LINE__); \
  37. DebugBreak(); \
  38. } \
  39. }
  40. #define ASSERTMSG(expr, msg) \
  41. { \
  42. if (!(expr)) \
  43. { \
  44. _TRACE (0, L"ACLDiag(%d): Assert: %s(%u)\n", \
  45. GetCurrentThreadId(), \
  46. StripDirPrefixA(__FILE__), __LINE__); \
  47. _TRACE (0, msg); \
  48. _TRACE (0, "\n"); \
  49. DebugBreak(); \
  50. } \
  51. }
  52. void CheckDebugOutputLevel ();
  53. #else // !DBG
  54. #define _TRACE
  55. #define TRACE
  56. #ifndef ASSERT
  57. #define ASSERT(expr)
  58. #endif
  59. #ifndef ASSERTMSG
  60. #define ASSERTMSG(expr, msg)
  61. #endif
  62. #endif
  63. #endif // ifndef _DEBUG_H_