debug.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /////////////////////////////////////////////////////////////////////////EA-V1
  19. // $File: //depot/GeneralsMD/Staging/code/Libraries/Source/debug/debug.h $
  20. // $Author: mhoffe $
  21. // $Revision: #1 $
  22. // $DateTime: 2003/07/03 11:55:26 $
  23. //
  24. // ©2003 Electronic Arts
  25. //
  26. // Debugging module
  27. //////////////////////////////////////////////////////////////////////////////
  28. #ifdef _MSC_VER
  29. # pragma once
  30. #endif
  31. #ifndef DEBUG_H // Include guard
  32. #define DEBUG_H
  33. /**
  34. \page lib_var Library variants
  35. Generally speaking there are four different library variants:
  36. - Internal: all asserts/checks/logs, full optimizations (_INTERNAL macro defined)
  37. - %Debug: all asserts/checks/logs, no optimizations (_DEBUG macro defined)
  38. - Profile: all asserts/checks/logs, full optimizations, profiling active (_PROFILE macro defined)
  39. - Release: no asserts/checks/logs, full optimizations
  40. These variants will be broken down into separate features which
  41. can be queried for by #ifdef(HAS_FEATURE):
  42. <table><tr>
  43. <td><b>Variant</b></td>
  44. <td><b>HAS_ASSERTS</b></td>
  45. <td><b>HAS_LOGS</b></td>
  46. <td><b>HAS_OPT</b></td>
  47. <td><b>HAS_PROFILE</b></td>
  48. </tr><tr>
  49. <td>Internal</td>
  50. <td><center>Y</center></td>
  51. <td><center>Y</center></td>
  52. <td><center>Y</center></td>
  53. <td><center></center></td>
  54. </tr><tr>
  55. <td>%Debug</td>
  56. <td><center>Y</center></td>
  57. <td><center>Y</center></td>
  58. <td><center></center></td>
  59. <td><center></center></td>
  60. </tr><tr>
  61. <td>Profile</td>
  62. <td><center>Y</center></td>
  63. <td><center>Y</center></td>
  64. <td><center>Y</center></td>
  65. <td><center>Y</center></td>
  66. </tr><tr>
  67. <td>Release</td>
  68. <td><center></center></td>
  69. <td><center></center></td>
  70. <td><center>Y</center></td>
  71. <td><center></center></td>
  72. </tr></table>
  73. Library files have a suffix appended that depends on the
  74. library variant:
  75. - Internal: XXXInternal.lib
  76. - %Debug: XXXDebug.lib
  77. - Profile: XXXProfile.lib
  78. - Release: XXX.lib
  79. */
  80. #if defined(_DEBUG) && defined(_INTERNAL)
  81. #error "Only either _DEBUG or _INTERNAL should ever be defined"
  82. #endif
  83. // Define which libraries to use.
  84. #if defined(_INTERNAL)
  85. # pragma comment (lib,"debuginternal.lib")
  86. # define HAS_ASSERTS
  87. # define HAS_LOGS
  88. # define HAS_OPT
  89. #elif defined(_DEBUG)
  90. # pragma comment (lib,"debugdebug.lib")
  91. # define HAS_ASSERTS
  92. # define HAS_LOGS
  93. #elif defined(_PROFILE)
  94. # pragma comment (lib,"debugprofile.lib")
  95. # define HAS_ASSERTS
  96. # define HAS_LOGS
  97. # define HAS_OPT
  98. # define HAS_PROFILE
  99. #else
  100. # pragma comment (lib,"debug.lib")
  101. # define HAS_OPT
  102. #endif
  103. // include all our public header files (use double quotes here)
  104. #include "debug_doc.h"
  105. #include "debug_macro.h"
  106. #include "debug_io.h"
  107. #include "debug_cmd.h"
  108. #include "debug_stack.h"
  109. #include "debug_debug.h"
  110. #endif // DEBUG_H