BsPrerequisitesUtil.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include <assert.h>
  5. /** @defgroup Utility Utility
  6. * Lowest layer of the engine containing a collection of very decoupled and separate systems that are
  7. * likely to be used throughout all of the higher layers.
  8. * @{
  9. */
  10. /** @defgroup Math Math
  11. * Math utility library containing a variety of general purpose math functionality.
  12. */
  13. /** @defgroup RTTI RTTI
  14. * A set of systems for defining and using run-time type information.
  15. */
  16. /** @defgroup Serialization Serialization
  17. * A set of systems for serializing and deserializing native objects.
  18. */
  19. /** @defgroup Memory Memory
  20. * A set of methods and classes meant to manipulate memory.
  21. */
  22. /** @defgroup Containers Containers
  23. * Contains a set of templated commonly used containers.
  24. */
  25. /** @defgroup Debug Debug
  26. * Contains functionality used to help with debugging.
  27. */
  28. /** @defgroup Error Error handling
  29. * Contains functionality used for handling and reporting errors.
  30. */
  31. /** @defgroup Filesystem File system
  32. * Contains functionality used for manipulating, reading and writing files.
  33. */
  34. /** @defgroup General General
  35. * Contains general utility functionality that doesn't fit in any other category.
  36. */
  37. /** @defgroup Image Image
  38. * Contains various utility methods for manipulating images.
  39. */
  40. /** @defgroup String String
  41. * Contains functionality for manipulating strings.
  42. */
  43. /** @defgroup Testing Testing
  44. * Contains functionality for running unit tests.
  45. */
  46. /** @defgroup Threading Threading
  47. * Contains functionality for manipulating threads and thread synchronization.
  48. */
  49. /** @defgroup RTTI-Impl-Utility RTTI types
  50. * Types containing RTTI for specific classes.
  51. */
  52. /** @defgroup Platform-Utility Platform
  53. * Platform specific functionality.
  54. */
  55. /** @} */
  56. /** @defgroup Implementation Implementation
  57. * Contains various base and helper types that used by an implementation of some other type. These shouldn't even be part
  58. * of the class list but due to limitations in the documentation generation system they need to be somewhere. All elements
  59. * listed here should instead be found by browsing the public interfaces of the types that use them.
  60. */
  61. // 0 - No thread support
  62. // 1 - Render system is thread safe (TODO: NOT WORKING and will probably be removed)
  63. // 2 - Thread support but render system can only be accessed from main thread
  64. #define BS_THREAD_SUPPORT 2
  65. #define BS_PROFILING_ENABLED 1
  66. // Versions
  67. #define BS_VER_DEV 1
  68. #define BS_VER_PREVIEW 2
  69. #define BS_VER BS_VER_DEV
  70. // Platform-specific stuff
  71. #include "BsPlatformDefines.h"
  72. #if BS_COMPILER == BS_COMPILER_MSVC
  73. // TODO - This is not deactivated anywhere, therefore it applies to any file that includes this header.
  74. // - Right now I don't have an easier way to apply these warnings globally so I'm keeping it this way.
  75. // Secure versions aren't multiplatform, so we won't be using them
  76. #define _CRT_SECURE_NO_WARNINGS
  77. // disable: "<type> needs to have dll-interface to be used by clients'
  78. // Happens on STL member variables which are not public therefore is ok
  79. # pragma warning (disable: 4251)
  80. // disable: 'X' Function call with parameters that may be unsafe
  81. # pragma warning(disable: 4996)
  82. // disable: decorated name length exceeded, name was truncated
  83. // Happens with really long type names. Even fairly standard use
  84. // of std::unordered_map with custom parameters, meaning I can't
  85. // really do much to avoid it. It shouldn't effect execution
  86. // but might cause problems if you compile library
  87. // with one compiler and use it in another.
  88. # pragma warning(disable: 4503)
  89. // disable: C++ exception handler used, but unwind semantics are not enabled
  90. // We don't care about this as any exception is meant to crash the program.
  91. # pragma warning(disable: 4530)
  92. #endif
  93. // Windows Settings
  94. #if BS_PLATFORM == BS_PLATFORM_WIN32
  95. // Win32 compilers use _DEBUG for specifying debug builds.
  96. // for MinGW, we set DEBUG
  97. # if defined(_DEBUG) || defined(DEBUG)
  98. # define BS_DEBUG_MODE 1
  99. # else
  100. # define BS_DEBUG_MODE 0
  101. # endif
  102. #endif
  103. // Linux/Apple Settings
  104. #if BS_PLATFORM == BS_PLATFORM_LINUX || BS_PLATFORM == BS_PLATFORM_OSX
  105. // A quick define to overcome different names for the same function
  106. # define stricmp strcasecmp
  107. # ifdef DEBUG
  108. # define BS_DEBUG_MODE 1
  109. # else
  110. # define BS_DEBUG_MODE 0
  111. # endif
  112. #endif
  113. #if BS_DEBUG_MODE
  114. #define BS_DEBUG_ONLY(x) x
  115. #define BS_ASSERT(x) assert(x)
  116. #else
  117. #define BS_DEBUG_ONLY(x)
  118. #define BS_ASSERT(x)
  119. #endif
  120. // Short-hand names for various built-in types
  121. #include "BsTypes.h"
  122. #include "BsMemoryAllocator.h"
  123. // Useful threading defines
  124. #include "BsThreadDefines.h"
  125. // Commonly used standard headers
  126. #include "BsStdHeaders.h"
  127. // Forward declarations
  128. #include "BsFwdDeclUtil.h"
  129. #include "BsRTTIPrerequisites.h"
  130. #include "BsString.h"
  131. #include "BsMessageHandlerFwd.h"
  132. #include "BsUtil.h"
  133. #include "BsPath.h"
  134. #include "BsStringID.h"
  135. #include "BsEvent.h"
  136. #include "BsPlatformUtility.h"
  137. #include "BsCrashHandler.h"