Team Fortress 2 Source Code as on 22/4/2020
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.

63 lines
1.8 KiB

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