aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/prusa-slicer-boost-fixes.patch
blob: 5bca271625afd028f97b5f9f827374b48b350c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Fixes for Boost compatibility.
This patch comes from Gentoo:
 portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_alpha2-boost-fixes.patch

--- a/src/hints/HintsToPot.cpp
+++ b/src/hints/HintsToPot.cpp
@@ -1,6 +1,7 @@
 #include <iostream>
 #include <vector>
 #include <string>
+#include <boost/nowide/fstream.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/dll.hpp>
 #include <boost/property_tree/ini_parser.hpp>
@@ -9,7 +10,7 @@
 
 bool write_to_pot(boost::filesystem::path path, const std::vector<std::pair<std::string, std::string>>& data)
 {
-	boost::filesystem::ofstream file(std::move(path), std::ios_base::app);
+	boost::nowide::ofstream file(std::move(path), std::ios_base::app);
 	for (const auto& element : data)
 	{
 		//Example of .pot element 
--- a/src/libslic3r/Preset.cpp
+++ b/src/libslic3r/Preset.cpp
@@ -25,6 +25,7 @@
 #include <stdexcept>
 #include <unordered_map>
 #include <boost/format.hpp>
+#include <boost/nowide/fstream.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/algorithm/string.hpp>
@@ -84,7 +85,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);
     boost::property_tree::read_ini(ifs, tree);
     return VendorProfile::from_ini(tree, path, load_all);
 }
--- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp
+++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp
@@ -10,6 +10,7 @@
 #include "libslic3r/Platform.hpp"
 #include "libslic3r/Config.hpp"
 
+#include <boost/nowide/fstream.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/log/trivial.hpp>
 #include <boost/dll/runtime_symbol_info.hpp>
@@ -503,4 +504,4 @@ DesktopIntegrationDialog::~DesktopIntegrationDialog()
 
 } // namespace GUI
 } // namespace Slic3r
-#endif // __linux__
\ No newline at end of file
+#endif // __linux__
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -13,6 +13,7 @@
 #include <cstdlib>
 #include <regex>
 #include <string_view>
+#include <boost/nowide/fstream.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/format.hpp>
--- a/src/slic3r/GUI/HintNotification.cpp
+++ b/src/slic3r/GUI/HintNotification.cpp
@@ -15,6 +15,7 @@
 #include "libslic3r/PrintConfig.hpp"
 
 #include <boost/algorithm/string/replace.hpp>
+#include <boost/nowide/fstream.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/nowide/fstream.hpp>
 #include <boost/log/trivial.hpp>
@@ -65,7 +66,7 @@ inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f
 
 void write_used_binary(const std::vector<std::string>& 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"), std::ios::binary);
 	cereal::BinaryOutputArchive archive(file);
 		HintsCerealData cd { ids };
 	try
@@ -84,7 +85,7 @@ void read_used_binary(std::vector<std::string>& 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);
 	cereal::BinaryInputArchive archive(file);
 	HintsCerealData cd;
 	try