From 0e40179aeb2ea15567a57e69109bdc5fe2ac4f36 Mon Sep 17 00:00:00 2001 From: zero9178 Date: Fri, 21 Aug 2020 03:01:50 +0200 Subject: [PATCH 1/2] Changed preprocessors checks for wchar_t constructs of iostreams from __GNUC__ to __GLIBCXX__ as libc++ provides these on Windows as well --- include/ghc/filesystem.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index 477447c..c901b03 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -1109,7 +1109,7 @@ public: const basic_filebuf& operator=(const basic_filebuf&) = delete; basic_filebuf* open(const path& p, std::ios_base::openmode mode) { -#if defined(GHC_OS_WINDOWS) && !defined(__GNUC__) +#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__) return std::basic_filebuf::open(p.wstring().c_str(), mode) ? this : 0; #else return std::basic_filebuf::open(p.string().c_str(), mode) ? this : 0; @@ -1122,7 +1122,7 @@ class basic_ifstream : public std::basic_ifstream { public: basic_ifstream() {} -#if defined(GHC_OS_WINDOWS) && !defined(__GNUC__) +#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__) explicit basic_ifstream(const path& p, std::ios_base::openmode mode = std::ios_base::in) : std::basic_ifstream(p.wstring().c_str(), mode) { @@ -1145,7 +1145,7 @@ class basic_ofstream : public std::basic_ofstream { public: basic_ofstream() {} -#if defined(GHC_OS_WINDOWS) && !defined(__GNUC__) +#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__) explicit basic_ofstream(const path& p, std::ios_base::openmode mode = std::ios_base::out) : std::basic_ofstream(p.wstring().c_str(), mode) { @@ -1168,7 +1168,7 @@ class basic_fstream : public std::basic_fstream { public: basic_fstream() {} -#if defined(GHC_OS_WINDOWS) && !defined(__GNUC__) +#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__) explicit basic_fstream(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) : std::basic_fstream(p.wstring().c_str(), mode) { From 9e69dd4a8253dd241d0f1913edc7ebcbc0b65d1c Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Fri, 21 Aug 2020 08:21:26 +0200 Subject: [PATCH 2/2] Updated readme and .gitignore --- .gitignore | 1 + README.md | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index ba6a447..9c1b199 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .vscode/ .idea/ *.swp +.DS_Store diff --git a/README.md b/README.md index 13fc557..11ee172 100644 --- a/README.md +++ b/README.md @@ -489,6 +489,12 @@ to the expected behavior. ### v1.3.3 (wip) +* Pull request [#69](https://github.com/gulrak/filesystem/pull/69), use `wchar_t` versions of + `std::fstream` from `ghc::filesystem::fstream` wrappers on Windows if using GCC with libc++. +* Bugfix for [#68](https://github.com/gulrak/filesystem/issues/68), better handling of + permission issues for directory iterators when using `fs::directory_options::skip_permission_denied`. + * Bugfix for [#63](https://github.com/gulrak/filesystem/issues/63), fixed issues on Windows + with clang++ and C++17. * Pull request [#62](https://github.com/gulrak/filesystem/pull/62), various fixes for better Android support, thanks for the PR * Pull request [#61](https://github.com/gulrak/filesystem/pull/61), `ghc::filesystem` now