mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
Try fixing build with gcc 13.3 (SoftFever/OrcaSlicer#5991) (#5992)
This commit is contained in:
parent
4ca0b24002
commit
adec6b7ebd
1 changed files with 7 additions and 3 deletions
|
@ -88,9 +88,13 @@ std::mutex g_mutex;
|
|||
|
||||
struct form_file
|
||||
{
|
||||
fs::ifstream ifs;
|
||||
fs::ifstream ifs;
|
||||
boost::filesystem::ifstream::off_type init_offset;
|
||||
size_t content_length;
|
||||
|
||||
form_file(fs::path const& p, const boost::filesystem::ifstream::off_type offset, const size_t content_length)
|
||||
: ifs(p, std::ios::in | std::ios::binary), init_offset(offset), content_length(content_length)
|
||||
{}
|
||||
};
|
||||
|
||||
struct Http::priv
|
||||
|
@ -314,7 +318,7 @@ void Http::priv::form_add_file(const char *name, const fs::path &path, const cha
|
|||
filename = path.string().c_str();
|
||||
}
|
||||
|
||||
form_files.emplace_back(form_file{{path, std::ios::in | std::ios::binary}, offset, length});
|
||||
form_files.emplace_back(path, offset, length);
|
||||
auto &f = form_files.back();
|
||||
size_t size = length;
|
||||
if (length == 0) {
|
||||
|
@ -381,7 +385,7 @@ void Http::priv::set_put_body(const fs::path &path)
|
|||
boost::system::error_code ec;
|
||||
boost::uintmax_t filesize = file_size(path, ec);
|
||||
if (!ec) {
|
||||
putFile = std::make_unique<form_file>(form_file{{path, std::ios_base::binary | std::ios_base::in}, 0, 0});
|
||||
putFile = std::make_unique<form_file>(path, 0, 0);
|
||||
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
::curl_easy_setopt(curl, CURLOPT_READDATA, (void *) (putFile.get()));
|
||||
::curl_easy_setopt(curl, CURLOPT_INFILESIZE, filesize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue