skypjack 2 недель назад
Родитель
Сommit
6ecae990ee
3 измененных файлов с 23 добавлено и 2 удалено
  1. 6 2
      src/entt/stl/limits.hpp
  2. 4 0
      test/entt/stl_ext/limits.cpp
  3. 13 0
      test/include/entt/ext/stl/limits.hpp

+ 6 - 2
src/entt/stl/limits.hpp

@@ -1,14 +1,18 @@
 #ifndef ENTT_STL_LIMITS_HPP
 #define ENTT_STL_LIMITS_HPP
 
-#include <limits>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/limits.hpp>)
+#    include <entt/ext/stl/limits.hpp>
+#else
+#    include <limits>
+
 namespace entt::stl {
 
 using std::numeric_limits;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

+ 4 - 0
test/entt/stl_ext/limits.cpp

@@ -1,2 +1,6 @@
 #include <gtest/gtest.h>
 #include <entt/stl/limits.hpp>
+
+TEST(Limits, HasInclude) {
+    static_assert(entt::stl::entt_ext_limits, "Header not properly included");
+}

+ 13 - 0
test/include/entt/ext/stl/limits.hpp

@@ -0,0 +1,13 @@
+#ifndef ENTT_EXT_STL_LIMITS_HPP
+#define ENTT_EXT_STL_LIMITS_HPP
+
+/*! @cond ENTT_INTERNAL */
+#include <limits>
+
+namespace entt::stl {
+using namespace std;
+static constexpr auto entt_ext_limits = true;
+} // namespace entt::stl
+/*! @endcond */
+
+#endif