Skip to content

Commit

Permalink
refs #17, fixed another issue on mingw when using wchar_t/wstring
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Jun 2, 2019
1 parent 2aa08c1 commit 2969bad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ class basic_filebuf : public std::basic_filebuf<charT, traits>
#if defined(GHC_OS_WINDOWS) && !defined(__GNUC__)
return std::basic_filebuf<charT, traits>::open(p.wstring().c_str(), mode) ? this : 0;
#else
return std::basic_filebuf<charT, traits>::open(p.c_str(), mode) ? this : 0;
return std::basic_filebuf<charT, traits>::open(p.string().c_str(), mode) ? this : 0;
#endif
}
};
Expand All @@ -948,10 +948,10 @@ class basic_ifstream : public std::basic_ifstream<charT, traits>
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.wstring().c_str(), mode); }
#else
explicit basic_ifstream(const path& p, std::ios_base::openmode mode = std::ios_base::in)
: std::basic_ifstream<charT, traits>(p.c_str(), mode)
: std::basic_ifstream<charT, traits>(p.string().c_str(), mode)
{
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.c_str(), mode); }
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.string().c_str(), mode); }
#endif
basic_ifstream(const basic_ifstream&) = delete;
const basic_ifstream& operator=(const basic_ifstream&) = delete;
Expand All @@ -971,10 +971,10 @@ class basic_ofstream : public std::basic_ofstream<charT, traits>
void open(const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.wstring().c_str(), mode); }
#else
explicit basic_ofstream(const path& p, std::ios_base::openmode mode = std::ios_base::out)
: std::basic_ofstream<charT, traits>(p.c_str(), mode)
: std::basic_ofstream<charT, traits>(p.string().c_str(), mode)
{
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.c_str(), mode); }
void open(const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.string().c_str(), mode); }
#endif
basic_ofstream(const basic_ofstream&) = delete;
const basic_ofstream& operator=(const basic_ofstream&) = delete;
Expand All @@ -994,10 +994,10 @@ class basic_fstream : public std::basic_fstream<charT, traits>
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.wstring().c_str(), mode); }
#else
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.c_str(), mode)
: std::basic_fstream<charT, traits>(p.string().c_str(), mode)
{
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.c_str(), mode); }
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.string().c_str(), mode); }
#endif
basic_fstream(const basic_fstream&) = delete;
const basic_fstream& operator=(const basic_fstream&) = delete;
Expand Down

0 comments on commit 2969bad

Please sign in to comment.