From d184015ded8e6a7c8fa9caf4bd778f79dade80e9 Mon Sep 17 00:00:00 2001 From: Toni500github <88878648+Toni500github@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:43:33 +0100 Subject: [PATCH 1/3] fix windows msys2 build --- include/toml++/impl/parser.inl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/toml++/impl/parser.inl b/include/toml++/impl/parser.inl index 8f1124b8..340eb13e 100644 --- a/include/toml++/impl/parser.inl +++ b/include/toml++/impl/parser.inl @@ -3784,11 +3784,7 @@ TOML_ANON_NAMESPACE_START std::ifstream file; TOML_OVERALIGNED char file_buffer[sizeof(void*) * 1024u]; file.rdbuf()->pubsetbuf(file_buffer, sizeof(file_buffer)); -#if TOML_WINDOWS - file.open(impl::widen(file_path_str).c_str(), std::ifstream::in | std::ifstream::binary | std::ifstream::ate); -#else file.open(file_path_str, std::ifstream::in | std::ifstream::binary | std::ifstream::ate); -#endif if (!file.is_open()) TOML_PARSE_FILE_ERROR("File could not be opened for reading", file_path_str); From 5d86fc916fc01aadaaed8f123cad4a8b4512519d Mon Sep 17 00:00:00 2001 From: Toni500github <88878648+Toni500github@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:55:54 +0100 Subject: [PATCH 2/3] Update toml.hpp --- toml.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/toml.hpp b/toml.hpp index 6de5332e..61626d3f 100644 --- a/toml.hpp +++ b/toml.hpp @@ -16342,11 +16342,7 @@ TOML_ANON_NAMESPACE_START std::ifstream file; TOML_OVERALIGNED char file_buffer[sizeof(void*) * 1024u]; file.rdbuf()->pubsetbuf(file_buffer, sizeof(file_buffer)); -#if TOML_WINDOWS - file.open(impl::widen(file_path_str).c_str(), std::ifstream::in | std::ifstream::binary | std::ifstream::ate); -#else file.open(file_path_str, std::ifstream::in | std::ifstream::binary | std::ifstream::ate); -#endif if (!file.is_open()) TOML_PARSE_FILE_ERROR("File could not be opened for reading", file_path_str); From a505754a462713024be81fa842fd3c23a67a9c9d Mon Sep 17 00:00:00 2001 From: Toni500git Date: Fri, 14 Mar 2025 13:16:16 +0100 Subject: [PATCH 3/3] improve solution --- include/toml++/impl/parser.inl | 4 ++++ toml.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/toml++/impl/parser.inl b/include/toml++/impl/parser.inl index 340eb13e..9768bfb5 100644 --- a/include/toml++/impl/parser.inl +++ b/include/toml++/impl/parser.inl @@ -3784,7 +3784,11 @@ TOML_ANON_NAMESPACE_START std::ifstream file; TOML_OVERALIGNED char file_buffer[sizeof(void*) * 1024u]; file.rdbuf()->pubsetbuf(file_buffer, sizeof(file_buffer)); +#if TOML_WINDOWS && !(defined(__MINGW32__) || defined(__MINGW64__)) + file.open(impl::widen(file_path_str).c_str(), std::ifstream::in | std::ifstream::binary | std::ifstream::ate); +#else file.open(file_path_str, std::ifstream::in | std::ifstream::binary | std::ifstream::ate); +#endif if (!file.is_open()) TOML_PARSE_FILE_ERROR("File could not be opened for reading", file_path_str); diff --git a/toml.hpp b/toml.hpp index 61626d3f..478db2a2 100644 --- a/toml.hpp +++ b/toml.hpp @@ -16342,7 +16342,11 @@ TOML_ANON_NAMESPACE_START std::ifstream file; TOML_OVERALIGNED char file_buffer[sizeof(void*) * 1024u]; file.rdbuf()->pubsetbuf(file_buffer, sizeof(file_buffer)); +#if TOML_WINDOWS && !(defined(__MINGW32__) || defined(__MINGW64__)) + file.open(impl::widen(file_path_str).c_str(), std::ifstream::in | std::ifstream::binary | std::ifstream::ate); +#else file.open(file_path_str, std::ifstream::in | std::ifstream::binary | std::ifstream::ate); +#endif if (!file.is_open()) TOML_PARSE_FILE_ERROR("File could not be opened for reading", file_path_str);