biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / bambu-studio / 0002-fix-build-for-gcc-13.diff
blobcc832bb107291f950a314581ae5f576fd3075255
1 diff --git a/src/slic3r/Utils/Http.cpp b/src/slic3r/Utils/Http.cpp
2 index 11a36dfabc..77a44e699b 100644
3 --- a/src/slic3r/Utils/Http.cpp
4 +++ b/src/slic3r/Utils/Http.cpp
5 @@ -88,9 +88,13 @@ std::mutex g_mutex;
7 struct form_file
9 - fs::ifstream ifs;
10 + fs::ifstream ifs;
11 boost::filesystem::ifstream::off_type init_offset;
12 size_t content_length;
14 + form_file(fs::path const& p, const boost::filesystem::ifstream::off_type offset, const size_t content_length)
15 + : ifs(p, std::ios::in | std::ios::binary), init_offset(offset), content_length(content_length)
16 + {}
19 struct Http::priv
20 @@ -314,7 +318,7 @@ void Http::priv::form_add_file(const char *name, const fs::path &path, const cha
21 filename = path.string().c_str();
24 - form_files.emplace_back(form_file{{path, std::ios::in | std::ios::binary}, offset, length});
25 + form_files.emplace_back(path, offset, length);
26 auto &f = form_files.back();
27 size_t size = length;
28 if (length == 0) {
29 @@ -381,7 +385,7 @@ void Http::priv::set_put_body(const fs::path &path)
30 boost::system::error_code ec;
31 boost::uintmax_t filesize = file_size(path, ec);
32 if (!ec) {
33 - putFile = std::make_unique<form_file>(form_file{{path, std::ios_base::binary | std::ios_base::in}, 0, 0});
34 + putFile = std::make_unique<form_file>(path, 0, 0);
35 ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
36 ::curl_easy_setopt(curl, CURLOPT_READDATA, (void *) (putFile.get()));
37 ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, filesize);