Skip to content

Commit

Permalink
Merge pull request #69 from zero9178/master
Browse files Browse the repository at this point in the history
Allow wchar_t constructors of iostreams on Windows when using libc++
  • Loading branch information
gulrak authored Aug 21, 2020
2 parents 2ea0017 + 0e40179 commit 46db4d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ class basic_filebuf : public std::basic_filebuf<charT, traits>
const basic_filebuf& operator=(const basic_filebuf&) = delete;
basic_filebuf<charT, traits>* 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<charT, traits>::open(p.wstring().c_str(), mode) ? this : 0;
#else
return std::basic_filebuf<charT, traits>::open(p.string().c_str(), mode) ? this : 0;
Expand All @@ -1122,7 +1122,7 @@ class basic_ifstream : public std::basic_ifstream<charT, traits>
{
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<charT, traits>(p.wstring().c_str(), mode)
{
Expand All @@ -1145,7 +1145,7 @@ class basic_ofstream : public std::basic_ofstream<charT, traits>
{
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<charT, traits>(p.wstring().c_str(), mode)
{
Expand All @@ -1168,7 +1168,7 @@ class basic_fstream : public std::basic_fstream<charT, traits>
{
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<charT, traits>(p.wstring().c_str(), mode)
{
Expand Down

0 comments on commit 46db4d8

Please sign in to comment.