🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
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.

79 lines
1.9 KiB

  1. #ifndef ENTT_CONFIG_CONFIG_H
  2. #define ENTT_CONFIG_CONFIG_H
  3. #include "version.h"
  4. #if defined(__cpp_exceptions) && !defined(ENTT_NOEXCEPTION)
  5. # define ENTT_THROW throw
  6. # define ENTT_TRY try
  7. # define ENTT_CATCH catch(...)
  8. #else
  9. # define ENTT_THROW
  10. # define ENTT_TRY if(true)
  11. # define ENTT_CATCH if(false)
  12. #endif
  13. #ifndef ENTT_NOEXCEPT
  14. # define ENTT_NOEXCEPT noexcept
  15. # define ENTT_NOEXCEPT_IF(expr) noexcept(expr)
  16. # else
  17. # define ENTT_NOEXCEPT_IF(...)
  18. #endif
  19. #ifdef ENTT_USE_ATOMIC
  20. # include <atomic>
  21. # define ENTT_MAYBE_ATOMIC(Type) std::atomic<Type>
  22. #else
  23. # define ENTT_MAYBE_ATOMIC(Type) Type
  24. #endif
  25. #ifndef ENTT_ID_TYPE
  26. # include <cstdint>
  27. # define ENTT_ID_TYPE std::uint32_t
  28. #endif
  29. #ifndef ENTT_SPARSE_PAGE
  30. # define ENTT_SPARSE_PAGE 4096
  31. #endif
  32. #ifndef ENTT_PACKED_PAGE
  33. # define ENTT_PACKED_PAGE 1024
  34. #endif
  35. #ifdef ENTT_DISABLE_ASSERT
  36. # undef ENTT_ASSERT
  37. # define ENTT_ASSERT(...) (void(0))
  38. #elif !defined ENTT_ASSERT
  39. # include <cassert>
  40. # define ENTT_ASSERT(condition, ...) assert(condition)
  41. #endif
  42. #ifdef ENTT_NO_ETO
  43. # define ENTT_IGNORE_IF_EMPTY false
  44. #else
  45. # define ENTT_IGNORE_IF_EMPTY true
  46. #endif
  47. #ifdef ENTT_STANDARD_CPP
  48. # define ENTT_NONSTD false
  49. #else
  50. # define ENTT_NONSTD true
  51. # if defined __clang__ || defined __GNUC__
  52. # define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
  53. # define ENTT_PRETTY_FUNCTION_PREFIX '='
  54. # define ENTT_PRETTY_FUNCTION_SUFFIX ']'
  55. # elif defined _MSC_VER
  56. # define ENTT_PRETTY_FUNCTION __FUNCSIG__
  57. # define ENTT_PRETTY_FUNCTION_PREFIX '<'
  58. # define ENTT_PRETTY_FUNCTION_SUFFIX '>'
  59. # endif
  60. #endif
  61. #if defined _MSC_VER
  62. # pragma detect_mismatch("entt.version", ENTT_VERSION)
  63. # pragma detect_mismatch("entt.noexcept", ENTT_XSTR(ENTT_TRY))
  64. # pragma detect_mismatch("entt.id", ENTT_XSTR(ENTT_ID_TYPE))
  65. # pragma detect_mismatch("entt.nonstd", ENTT_XSTR(ENTT_NONSTD))
  66. #endif
  67. #endif