Browse Source

config: use pragma detect_mismatch if possible

Michele Caini 4 năm trước cách đây
mục cha
commit
ad5b362bca
1 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 11 1
      src/entt/config/config.h

+ 11 - 1
src/entt/config/config.h

@@ -30,6 +30,7 @@
 #endif
 
 #ifndef ENTT_ID_TYPE
+#    include <cstdint>
 #    define ENTT_ID_TYPE std::uint32_t
 #endif
 
@@ -55,7 +56,10 @@
 #    define ENTT_IGNORE_IF_EMPTY true
 #endif
 
-#ifndef ENTT_STANDARD_CPP
+#ifdef ENTT_STANDARD_CPP
+#    define ENTT_NONSTD false
+#else
+#    define ENTT_NONSTD true
 #    if defined __clang__ || defined __GNUC__
 #        define ENTT_PRETTY_FUNCTION __PRETTY_FUNCTION__
 #        define ENTT_PRETTY_FUNCTION_PREFIX '='
@@ -69,6 +73,12 @@
 
 #if defined _MSC_VER
 #    pragma detect_mismatch("entt.version", ENTT_VERSION)
+#    pragma detect_mismatch("entt.noexcept", ENTT_XSTR(ENTT_TRY))
+#    pragma detect_mismatch("entt.id", ENTT_XSTR(ENTT_ID_TYPE))
+#    pragma detect_mismatch("entt.sparse", ENTT_XSTR(ENTT_SPARSE_PAGE))
+#    pragma detect_mismatch("entt.packed", ENTT_XSTR(ENTT_PACKED_PAGE))
+#    pragma detect_mismatch("entt.eto", ENTT_XSTR(ENTT_IGNORE_IF_EMPTY))
+#    pragma detect_mismatch("entt.nonstd", ENTT_XSTR(ENTT_NONSTD))
 #endif
 
 #endif