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.

56 lines
1.6 KiB

  1. #if !defined(AFX_DEBUG_H__8DEDB8FC_5C6D_11D1_8CCD_00C04FD918D0__INCLUDED_)
  2. #define AFX_DEBUG_H__8DEDB8FC_5C6D_11D1_8CCD_00C04FD918D0__INCLUDED_
  3. /////////////////////////////////////////////////////////////////////////////
  4. // Diagnostic support
  5. #ifdef _PSEUDO_DEBUG
  6. #undef TRACE
  7. #undef VERIFY
  8. #undef ASSERT
  9. #undef THIS_FILE
  10. #undef TRACE0
  11. #undef TRACE1
  12. #undef TRACE2
  13. #undef TRACE3
  14. // Note: file names are still ANSI strings (filenames rarely need UNICODE)
  15. BOOL AssertFailedLine(LPCSTR lpszFileName, int nLine);
  16. void Trace(LPCTSTR lpszFormat, ...);
  17. // by default, debug break is asm int 3, or a call to DebugBreak, or nothing
  18. #if defined(_M_IX86)
  19. #define CustomDebugBreak() _asm { int 3 }
  20. #else
  21. #define CustomDebugBreak() DebugBreak()
  22. #endif
  23. #define TRACE ::Trace
  24. #define THIS_FILE __FILE__
  25. #define ASSERT(f) \
  26. do \
  27. { \
  28. if (!(f) && AssertFailedLine(THIS_FILE, __LINE__)) \
  29. CustomDebugBreak(); \
  30. } while (0) \
  31. #define VERIFY(f) ASSERT(f)
  32. // The following trace macros are provided for backward compatiblity
  33. // (they also take a fixed number of parameters which provides
  34. // some amount of extra error checking)
  35. #define TRACE0(sz) ::Trace(_T(sz))
  36. #define TRACE1(sz, p1) ::Trace(_T(sz), p1)
  37. #define TRACE2(sz, p1, p2) ::Trace(_T(sz), p1, p2)
  38. #define TRACE3(sz, p1, p2, p3) ::Trace(_T(sz), p1, p2, p3)
  39. #endif // !_PSEUDO_DEBUG
  40. //{{AFX_INSERT_LOCATION}}
  41. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  42. #endif // !defined(AFX_DEBUG_H__8DEDB8FC_5C6D_11D1_8CCD_00C04FD918D0__INCLUDED_)