浏览代码

stl: drop ENTT_HAS_VERSION

skypjack 1 周之前
父节点
当前提交
377dde3e24
共有 6 个文件被更改,包括 12 次插入25 次删除
  1. 3 7
      src/entt/config/config.h
  2. 2 4
      src/entt/stl/functional.hpp
  3. 2 4
      src/entt/stl/iterator.hpp
  4. 2 4
      src/entt/stl/memory.hpp
  5. 3 5
      src/entt/stl/ranges.hpp
  6. 0 1
      src/entt/stl/version.hpp

+ 3 - 7
src/entt/config/config.h

@@ -24,13 +24,9 @@
 #    define ENTT_CATCH if(false)
 #endif
 
-#ifdef ENTT_HAS_VERSION
-#    if defined(__cpp_consteval)
-#        define ENTT_CONSTEVAL consteval
-#    endif
-#endif
-
-#ifndef ENTT_CONSTEVAL
+#if defined(__cpp_consteval)
+#    define ENTT_CONSTEVAL consteval
+#else
 #    define ENTT_CONSTEVAL constexpr
 #endif
 

+ 2 - 4
src/entt/stl/functional.hpp

@@ -17,9 +17,8 @@ using std::less;
 } // namespace entt::stl
 
 #ifndef ENTT_FORCE_STL
-#    ifdef ENTT_HAS_VERSION
-#        if defined(__cpp_lib_ranges)
-#            define ENTT_HAS_IDENTITY
+#    if defined(__cpp_lib_ranges)
+#        define ENTT_HAS_IDENTITY
 
 namespace entt::stl {
 
@@ -27,7 +26,6 @@ using std::identity;
 
 } // namespace entt::stl
 
-#        endif
 #    endif
 #endif
 

+ 2 - 4
src/entt/stl/iterator.hpp

@@ -19,9 +19,8 @@ using std::random_access_iterator_tag;
 using std::reverse_iterator;
 
 #ifndef ENTT_FORCE_STL
-#    ifdef ENTT_HAS_VERSION
-#        if defined(__cpp_lib_ranges)
-#            define ENTT_HAS_ITERATOR_CONCEPTS
+#    if defined(__cpp_lib_ranges)
+#        define ENTT_HAS_ITERATOR_CONCEPTS
 
 using std::bidirectional_iterator;
 using std::forward_iterator;
@@ -31,7 +30,6 @@ using std::output_iterator;
 using std::random_access_iterator;
 using std::sentinel_for;
 
-#        endif
 #    endif
 #endif
 

+ 2 - 4
src/entt/stl/memory.hpp

@@ -29,9 +29,8 @@ using std::uses_allocator_v;
 } // namespace entt::stl
 
 #ifndef ENTT_FORCE_STL
-#    ifdef ENTT_HAS_VERSION
-#        if defined(__cpp_lib_to_address)
-#            define ENTT_HAS_TO_ADDRESS
+#    if defined(__cpp_lib_to_address)
+#        define ENTT_HAS_TO_ADDRESS
 
 namespace entt::stl {
 
@@ -39,7 +38,6 @@ using std::to_address;
 
 } // namespace entt::stl
 
-#        endif
 #    endif
 #endif
 

+ 3 - 5
src/entt/stl/ranges.hpp

@@ -3,10 +3,9 @@
 
 #include "../stl/version.hpp"
 
-#ifdef ENTT_HAS_VERSION
-#    if defined(__cpp_lib_ranges)
-#        include <ranges>
-#        define ENTT_HAS_RANGES
+#if defined(__cpp_lib_ranges)
+#    include <ranges>
+#    define ENTT_HAS_RANGES
 
 /*! @cond ENTT_INTERNAL */
 namespace entt::stl::ranges {
@@ -17,7 +16,6 @@ using std::ranges::enable_view;
 } // namespace entt::stl::ranges
 /*! @endcond */
 
-#    endif
 #endif
 
 #endif

+ 0 - 1
src/entt/stl/version.hpp

@@ -3,7 +3,6 @@
 
 #if __has_include(<version>)
 #    include <version>
-#    define ENTT_HAS_VERSION
 #endif
 
 #endif