Partially revert "Remove the gulrak submodule"

This reverts commit 376518a6ec.
This commit is contained in:
Povilas Kanapickas
2024-10-14 05:24:05 +03:00
parent 1879b1eaab
commit 4a91ea9d9a
4 changed files with 15 additions and 2 deletions

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "ext/gtest"]
path = ext/gtest
url = https://github.com/google/googletest.git
[submodule "ext/gulrak-filesystem"]
path = ext/gulrak-filesystem
url = https://github.com/gulrak/filesystem

1
ext/gulrak-filesystem Submodule

Submodule ext/gulrak-filesystem added at 614bbe87b8

View File

@@ -15,6 +15,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// this header must come first so that it picks up the filesystem implementation
#include <ghc/fs_impl.hpp>
#include "filesystem.h"
#if SYSAPI_WIN32
#include "common/win32/encoding_utilities.h"
@@ -28,7 +31,13 @@ namespace {
template<class Stream>
void open_utf8_path_impl(Stream& stream, const fs::path& path, std::ios_base::openmode mode)
{
#if SYSAPI_WIN32
// on Windows we need to use a non-standard constructor from wchar_t* string
// which fs::path::native() returns
stream.open(path.native().c_str(), mode);
#else
stream.open(path.native().c_str(), mode);
#endif
}
} // namespace

View File

@@ -20,11 +20,11 @@
#include <cstdio>
#include <iosfwd>
#include <ios>
#include <filesystem>
#include <ghc/fs_fwd.hpp>
namespace inputleap {
namespace fs = std::filesystem;
namespace fs = ghc::filesystem;
void open_utf8_path(std::ifstream& stream, const fs::path& path,
std::ios_base::openmode mode = std::ios_base::in);