Преглед на файлове

stl: allow injecting ios

skypjack преди 4 дни
родител
ревизия
7d5ce4ec3e
променени са 3 файла, в които са добавени 23 реда и са изтрити 2 реда
  1. 6 2
      src/entt/stl/ios.hpp
  2. 4 0
      test/entt/stl_ext/ios.cpp
  3. 13 0
      test/include/entt/ext/stl/ios.hpp

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

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

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

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

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

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