File 0010-replace-deprecated-boost-asio-deadline_timer.patch of Package SuperSlicer
From bf1e5840c2476c90230a28e7707ce64d8fce3224 Mon Sep 17 00:00:00 2001
From: Mia Herkt <mia@0x0.st>
Date: Wed, 12 Nov 2025 13:12:10 +0100
Subject: [PATCH 10/11] replace deprecated boost::asio deadline_timer
---
src/slic3r/Utils/Bonjour.cpp | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/slic3r/Utils/Bonjour.cpp b/src/slic3r/Utils/Bonjour.cpp
index 0867c22b33..87b3ece95e 100644
--- a/src/slic3r/Utils/Bonjour.cpp
+++ b/src/slic3r/Utils/Bonjour.cpp
@@ -12,7 +12,6 @@
#include <map>
#include <thread>
#include <boost/endian/conversion.hpp>
-#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/format.hpp>
#include <boost/log/trivial.hpp>
#include <boost/bind/bind.hpp>
@@ -923,7 +922,7 @@ void Bonjour::priv::lookup_perform()
socket->send();
// timer settings
- asio::deadline_timer timer(*io_context);
+ asio::system_timer timer(*io_context);
retries--;
std::function<void(const error_code&)> timer_handler = [&](const error_code& error) {
// end
@@ -936,7 +935,7 @@ void Bonjour::priv::lookup_perform()
// restart timer
} else {
retries--;
- timer.expires_from_now(boost::posix_time::seconds(timeout));
+ timer.expires_after(std::chrono::seconds(timeout));
timer.async_wait(timer_handler);
// trigger another round of queries
for (auto * socket : sockets)
@@ -944,7 +943,7 @@ void Bonjour::priv::lookup_perform()
}
};
// start timer
- timer.expires_from_now(boost::posix_time::seconds(timeout));
+ timer.expires_after(std::chrono::seconds(timeout));
timer.async_wait(timer_handler);
// start io_service, it will run until it has something to do - so in this case until stop is called in timer
io_context->run();
@@ -1016,7 +1015,7 @@ void Bonjour::priv::resolve_perform()
socket->send();
// timer settings
- asio::deadline_timer timer(*io_context);
+ asio::system_timer timer(*io_context);
retries--;
std::function<void(const error_code&)> timer_handler = [&](const error_code& error) {
int replies_count = replies.size();
@@ -1030,7 +1029,7 @@ void Bonjour::priv::resolve_perform()
// restart timer
} else {
retries--;
- timer.expires_from_now(boost::posix_time::seconds(timeout));
+ timer.expires_after(std::chrono::seconds(timeout));
timer.async_wait(timer_handler);
// trigger another round of queries
for (auto * socket : sockets)
@@ -1038,7 +1037,7 @@ void Bonjour::priv::resolve_perform()
}
};
// start timer
- timer.expires_from_now(boost::posix_time::seconds(timeout));
+ timer.expires_after(std::chrono::seconds(timeout));
timer.async_wait(timer_handler);
// start io_service, it will run until it has something to do - so in this case until stop is called in timer
io_context->run();
--
2.51.1