diff --git a/PrusaSlicer-boost1.79.patch b/PrusaSlicer-boost1.79.patch index 25c78b4..f32d1cd 100644 --- a/PrusaSlicer-boost1.79.patch +++ b/PrusaSlicer-boost1.79.patch @@ -1,31 +1,112 @@ -Index: PrusaSlicer-version_2.4.1/src/hints/HintsToPot.cpp -=================================================================== ---- PrusaSlicer-version_2.4.1.orig/src/hints/HintsToPot.cpp -+++ PrusaSlicer-version_2.4.1/src/hints/HintsToPot.cpp -@@ -1,4 +1,5 @@ - #include -+#include - #include - #include - #include -@@ -9,7 +10,7 @@ +From 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Mon Sep 17 00:00:00 2001 +From: Vojtech Bubnik +Date: Mon, 25 Apr 2022 08:33:48 +0200 +Subject: [PATCH] Fix of Boost 1.79 deprecated boost::filesystem::ofstream + #8238 Replacing boost::filesystem::fstream with boost::nowide::fstream + variants with the unfortunate cost of string path conversion on Windows from + 16 bits to UTF8 and back to 16 bits. + +Unfortunately we cannot use std::filesystem yet as it is missing +on older MACs and because the interface is crooked minefield on Windows +see https://github.com/microsoft/STL/issues/909 +--- + src/hints/HintsToPot.cpp | 2 +- + src/libslic3r/Preset.cpp | 2 +- + src/slic3r/GUI/HintNotification.cpp | 8 +++++--- + 3 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/hints/HintsToPot.cpp b/src/hints/HintsToPot.cpp +index 7c8029cdeb..4791f0612f 100644 +--- a/src/hints/HintsToPot.cpp ++++ b/src/hints/HintsToPot.cpp +@@ -9,7 +9,7 @@ bool write_to_pot(boost::filesystem::path path, const std::vector>& data) { - boost::filesystem::ofstream file(std::move(path), std::ios_base::app); -+ std::ofstream file(std::move(path.string()), std::ios_base::app); ++ boost::nowide::ofstream file(path.string(), std::ios_base::app); for (const auto& element : data) { //Example of .pot element -Index: PrusaSlicer-version_2.4.1/tests/fff_print/test_data.cpp -=================================================================== ---- PrusaSlicer-version_2.4.1.orig/tests/fff_print/test_data.cpp -+++ PrusaSlicer-version_2.4.1/tests/fff_print/test_data.cpp -@@ -9,6 +9,7 @@ +diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp +index f3a1c15b3e..f171cb14dd 100644 +--- a/src/libslic3r/Preset.cpp ++++ b/src/libslic3r/Preset.cpp +@@ -84,7 +84,7 @@ ConfigFileType guess_config_file_type(const ptree &tree) + VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all) + { + ptree tree; +- boost::filesystem::ifstream ifs(path); ++ boost::nowide::ifstream ifs(path.string()); + boost::property_tree::read_ini(ifs, tree); + return VendorProfile::from_ini(tree, path, load_all); + } +diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp +index 93e0fb3259..820b74eedb 100644 +--- a/src/slic3r/GUI/HintNotification.cpp ++++ b/src/slic3r/GUI/HintNotification.cpp +@@ -14,12 +14,14 @@ + #include "libslic3r/Config.hpp" + #include "libslic3r/PrintConfig.hpp" - #include ++#include ++ + #include + #include + #include + #include + #include +-#include ++ + #include + #include + #include +@@ -65,7 +67,7 @@ inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f + + void write_used_binary(const std::vector& ids) + { +- boost::filesystem::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary); ++ boost::nowide::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal").string(), std::ios::binary); + cereal::BinaryOutputArchive archive(file); + HintsCerealData cd { ids }; + try +@@ -84,7 +86,7 @@ void read_used_binary(std::vector& ids) + BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string(); + return; + } +- boost::filesystem::ifstream file(path); ++ boost::nowide::ifstream file(path.string()); + cereal::BinaryInputArchive archive(file); + HintsCerealData cd; + try +From 926ae0471800abd1e5335e251a5934570eb8f6ff Mon Sep 17 00:00:00 2001 +From: Vojtech Bubnik +Date: Mon, 25 Apr 2022 11:32:03 +0200 +Subject: [PATCH] Follow-up to 408e56f0390f20aaf793e0aa0c70c4d9544401d4 Fixing + compilation of tests on latest GCC/boost + +--- + tests/fff_print/test_data.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/fff_print/test_data.cpp b/tests/fff_print/test_data.cpp +index 32e31c264c..f7077007db 100644 +--- a/tests/fff_print/test_data.cpp ++++ b/tests/fff_print/test_data.cpp +@@ -11,6 +11,7 @@ #include -+#include #include ++#include #include + #include + +@@ -286,7 +287,7 @@ std::string gcode(Print & print) + print.set_status_silent(); + print.process(); + print.export_gcode(temp.string(), nullptr, nullptr); +- std::ifstream t(temp.string()); ++ boost::nowide::ifstream t(temp.string()); + std::string str((std::istreambuf_iterator(t)), std::istreambuf_iterator()); + boost::nowide::remove(temp.string().c_str()); + return str; diff --git a/PrusaSlicer.changes b/PrusaSlicer.changes index d0b912c..27e8898 100644 --- a/PrusaSlicer.changes +++ b/PrusaSlicer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 25 11:27:58 UTC 2022 - Ben Greiner + +- Refresh PrusaSlicer-boost1.79.patch with upstream's fix + * gh#prusa3d/PrusaSlicer#8238 + ------------------------------------------------------------------- Sun Apr 24 09:26:22 UTC 2022 - Ben Greiner