Counter Strike : Global Offensive Source Code
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.

68 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This file sets all of our debugging flags. It should be
  4. // called before all other header files.
  5. //
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef DBGFLAG_H
  9. #define DBGFLAG_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. // Here are all the flags we support:
  14. // DBGFLAG_MEMORY: Enables our memory debugging system, which overrides malloc & free
  15. // DBGFLAG_MEMORY_NEWDEL: Enables new / delete tracking for memory debug system. Requires DBGFLAG_MEMORY to be enabled.
  16. // DBGFLAG_VALIDATE: Enables our recursive validation system for checking integrity and memory leaks
  17. // DBGFLAG_ASSERT: Turns Assert on or off (when off, it isn't compiled at all)
  18. // DBGFLAG_ASSERTFATAL: Turns AssertFatal on or off (when off, it isn't compiled at all)
  19. // DBGFLAG_ASSERTDLG: Turns assert dialogs on or off and debug breaks on or off when not under the debugger.
  20. // (Dialogs will always be on when process is being debugged.)
  21. // DBGFLAG_STRINGS: Turns on hardcore string validation (slow but safe)
  22. #undef DBGFLAG_MEMORY
  23. #undef DBGFLAG_MEMORY_NEWDEL
  24. #undef DBGFLAG_VALIDATE
  25. #undef DBGFLAG_ASSERT
  26. #undef DBGFLAG_ASSERTFATAL
  27. #undef DBGFLAG_ASSERTDLG
  28. #undef DBGFLAG_STRINGS
  29. //-----------------------------------------------------------------------------
  30. // Default flags for debug builds
  31. //-----------------------------------------------------------------------------
  32. #if defined( _DEBUG ) && !defined( PS3MEMOVERRIDEWRAP )
  33. #define DBGFLAG_MEMORY
  34. #ifdef _SERVER // only enable new & delete tracking for server; on client it conflicts with CRT mem leak tracking
  35. #define DBGFLAG_MEMORY_NEWDEL
  36. #endif
  37. #ifdef STEAM
  38. #define DBGFLAG_VALIDATE
  39. #endif
  40. #define DBGFLAG_ASSERT
  41. #define DBGFLAG_ASSERTFATAL
  42. #define DBGFLAG_ASSERTDLG
  43. #define DBGFLAG_STRINGS
  44. //-----------------------------------------------------------------------------
  45. // Default flags for release builds
  46. //-----------------------------------------------------------------------------
  47. #else // _DEBUG
  48. #ifdef STEAM
  49. #define DBGFLAG_ASSERT
  50. #endif
  51. #define DBGFLAG_ASSERTFATAL // note: fatal asserts are enabled in release builds
  52. #define DBGFLAG_ASSERTDLG
  53. #endif // _DEBUG
  54. #if defined( _CERT )
  55. #define DBGFLAG_STRINGS_STRIP
  56. #endif
  57. #endif // DBGFLAG_H