4 コミット 90b09969f2 ... e0ce66c098

作者 SHA1 メッセージ 日付
  skypjack e0ce66c098 stl: allow injecting cstdint 5 日 前
  skypjack e1ab4106c7 stl: allow injecting cstddef 5 日 前
  skypjack 15a8fe19b4 stl: support injecting concepts 5 日 前
  skypjack ab227a3ef0 stl: support injecting cmath 5 日 前

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

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

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

@@ -1,9 +1,12 @@
 #ifndef ENTT_STL_CONCEPTS_HPP
 #define ENTT_STL_CONCEPTS_HPP
 
-#include <concepts>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/concepts.hpp>)
+#    include <entt/ext/stl/concepts.hpp>
+#else
+#    include <concepts>
+
 namespace entt::stl {
 
 using std::constructible_from;
@@ -15,6 +18,7 @@ using std::same_as;
 using std::unsigned_integral;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

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

@@ -1,9 +1,12 @@
 #ifndef ENTT_STL_CSTDDEF_HPP
 #define ENTT_STL_CSTDDEF_HPP
 
-#include <cstddef>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/cstddef.hpp>)
+#    include <entt/ext/stl/cstddef.hpp>
+#else
+#    include <cstddef>
+
 namespace entt::stl {
 
 using std::byte;
@@ -12,6 +15,7 @@ using std::ptrdiff_t;
 using std::size_t;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

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

@@ -1,9 +1,12 @@
 #ifndef ENTT_STL_CSTDINT_HPP
 #define ENTT_STL_CSTDINT_HPP
 
-#include <cstdint>
-
 /*! @cond ENTT_INTERNAL */
+#if __has_include(<entt/ext/stl/cstdint.hpp>)
+#    include <entt/ext/stl/cstdint.hpp>
+#else
+#    include <cstdint>
+
 namespace entt::stl {
 
 using std::uint16_t;
@@ -12,6 +15,7 @@ using std::uint64_t;
 using std::uint8_t;
 
 } // namespace entt::stl
+#endif
 /*! @endcond */
 
 #endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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