Browse Source

core: update guard for ranges

Michele Caini 1 year ago
parent
commit
fe76478dbc
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/entt/core/ranges.hpp

+ 7 - 4
src/entt/core/ranges.hpp

@@ -1,10 +1,12 @@
 #ifndef ENTT_CORE_RANGES_HPP
 #ifndef ENTT_CORE_RANGES_HPP
 #define ENTT_CORE_RANGES_HPP
 #define ENTT_CORE_RANGES_HPP
 
 
-#if __cplusplus >= 202002L
-
-#    include <ranges>
-#    include "iterator.hpp"
+#if __has_include(<version>)
+#    include <version>
+#
+#    if defined(__cpp_lib_ranges)
+#        include <ranges>
+#        include "iterator.hpp"
 
 
 template<class... Args>
 template<class... Args>
 inline constexpr bool std::ranges::enable_borrowed_range<entt::iterable_adaptor<Args...>>{true};
 inline constexpr bool std::ranges::enable_borrowed_range<entt::iterable_adaptor<Args...>>{true};
@@ -12,6 +14,7 @@ inline constexpr bool std::ranges::enable_borrowed_range<entt::iterable_adaptor<
 template<class... Args>
 template<class... Args>
 inline constexpr bool std::ranges::enable_view<entt::iterable_adaptor<Args...>>{true};
 inline constexpr bool std::ranges::enable_view<entt::iterable_adaptor<Args...>>{true};
 
 
+#    endif
 #endif
 #endif
 
 
 #endif
 #endif