From 603dacf69e902ec12f1b0ee4fede848f23e7f7e0 Mon Sep 17 00:00:00 2001 From: Nahuel Gaitan <45178494+N4gtan@users.noreply.github.com> Date: Thu, 1 Jan 2026 22:21:38 -0300 Subject: [PATCH 1/2] add to dynamic headers --- README.md | 2 ++ include/ghc/fs_std.hpp | 1 + include/ghc/fs_std_fwd.hpp | 1 + 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index f510042..4ecb61e 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,7 @@ you might use: #ifdef GHC_USE_STD_FS #include + #include namespace fs { using namespace std::filesystem; using ifstream = std::ifstream; @@ -318,6 +319,7 @@ switching like this: #ifdef GHC_USE_STD_FS #include + #include namespace fs { using namespace std::filesystem; using ifstream = std::ifstream; diff --git a/include/ghc/fs_std.hpp b/include/ghc/fs_std.hpp index f09eeec..9eb38ac 100644 --- a/include/ghc/fs_std.hpp +++ b/include/ghc/fs_std.hpp @@ -58,6 +58,7 @@ #ifdef GHC_USE_STD_FS #include + #include namespace fs { using namespace std::filesystem; using ifstream = std::ifstream; diff --git a/include/ghc/fs_std_fwd.hpp b/include/ghc/fs_std_fwd.hpp index 372470f..3114d75 100644 --- a/include/ghc/fs_std_fwd.hpp +++ b/include/ghc/fs_std_fwd.hpp @@ -60,6 +60,7 @@ #ifdef GHC_USE_STD_FS #include + #include namespace fs { using namespace std::filesystem; using ifstream = std::ifstream; From cdbf7835b4cc1d54a78b57a9ba25e00c87a078af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schu=CC=88mann?= Date: Sat, 11 Jul 2026 21:22:17 +0200 Subject: [PATCH 2/2] Add tests addition and update CMake --- test/CMakeLists.txt | 8 ++++++++ test/fs_std_fwd_header_test.cpp | 8 ++++++++ test/fs_std_header_test.cpp | 10 ++++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/fs_std_fwd_header_test.cpp create mode 100644 test/fs_std_header_test.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1401ef0..5364435 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -97,6 +97,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) endif() add_test(fwd_impl_test fwd_impl_test) +if("cxx_std_17" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES) + add_executable(fs_std_header_test fs_std_header_test.cpp fs_std_fwd_header_test.cpp) + target_link_libraries(fs_std_header_test ghc_filesystem) + target_compile_features(fs_std_header_test PRIVATE cxx_std_17) + SetTestCompileOptions(fs_std_header_test) + add_test(fs_std_header_test fs_std_header_test) +endif() + add_executable(exception exception.cpp) if(NOT MSVC) target_compile_options(exception PRIVATE -fno-exceptions) diff --git a/test/fs_std_fwd_header_test.cpp b/test/fs_std_fwd_header_test.cpp new file mode 100644 index 0000000..132d0ea --- /dev/null +++ b/test/fs_std_fwd_header_test.cpp @@ -0,0 +1,8 @@ +#define GHC_USE_STD_FS +#include + +bool fs_std_fwd_header_test() +{ + fs::fstream stream; + return stream.is_open(); +} diff --git a/test/fs_std_header_test.cpp b/test/fs_std_header_test.cpp new file mode 100644 index 0000000..52b9ba8 --- /dev/null +++ b/test/fs_std_header_test.cpp @@ -0,0 +1,10 @@ +#define GHC_USE_STD_FS +#include + +bool fs_std_fwd_header_test(); + +int main() +{ + fs::ifstream stream; + return stream.is_open() || fs_std_fwd_header_test() ? 1 : 0; +}