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.

46 lines
1.0 KiB

  1. #ifndef __debug_h__
  2. #define __debug_h__
  3. // For compatibility with WINNT build environment:
  4. #if DBG
  5. #define DEBUG 1
  6. #endif
  7. #ifdef DEBUG
  8. #define DebugTrap DebugBreak();
  9. #ifdef LOTS_O_DEBUG
  10. #include <objbase.h>
  11. #include <objerror.h>
  12. // Simple debug statements
  13. #define DebugSz(sz) MessageBox (GetFocus(), sz, NULL, MB_OK)
  14. void _DebugHr (HRESULT hr, LPTSTR lpszFile, DWORD dwLine);
  15. #define DebugHr(hr) _DebugHr (hr, __FILE__, __LINE__)
  16. #else //LOTS_O_DEBUG
  17. #define DebugSz(sz)
  18. #define DebugHr(hr)
  19. #endif // LOTS_O_DEBUG
  20. void _Assert (DWORD dw, LPSTR lpszExp, LPSTR lpszFile, DWORD dwLine);
  21. void _AssertSz (DWORD dw, LPSTR lpszExp, LPTSTR lpsz, LPSTR lpszFile, DWORD dwLine);
  22. #define Assert(dw) if (!(dw)) _Assert((dw), (#dw), __FILE__, __LINE__)
  23. #define AssertSz(dw,sz) if (!(dw)) _AssertSz ((dw), (#dw), (sz), __FILE__, __LINE__)
  24. #else // DEBUG
  25. #define Assert(dw)
  26. #define AssertSz(dw,sz)
  27. #define DebugSz(sz)
  28. #define DebugHr(hr)
  29. #endif // DEBUG
  30. #endif // __debug_h__