From e92067b5de2e0c4afd66786c250ae3117a25a0df Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 19 Jan 2025 11:11:21 +0100 Subject: [PATCH] fix: support boost 1.87 (#5832) Co-authored-by: Nerixyz --- .gitmodules | 3 ++- CHANGELOG.md | 1 + lib/websocketpp | 2 +- src/controllers/sound/MiniaudioBackend.cpp | 2 +- src/providers/liveupdates/BasicPubSubManager.hpp | 9 ++++++--- src/providers/twitch/PubSubHelpers.hpp | 9 ++++----- src/providers/twitch/PubSubManager.cpp | 5 +++-- src/providers/twitch/PubSubManager.hpp | 6 ++++-- 8 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.gitmodules b/.gitmodules index 219a91bf..48e6d706 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,7 +22,8 @@ url = https://github.com/Chatterino/qtkeychain [submodule "lib/websocketpp"] path = lib/websocketpp - url = https://github.com/zaphoyd/websocketpp + url = https://github.com/Chatterino/websocketpp + branch = chatterino [submodule "cmake/sanitizers-cmake"] path = cmake/sanitizers-cmake url = https://github.com/arsenm/sanitizers-cmake diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab8dea4..89036d70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Bugfix: Fixed tabs not scaling to the default scale when changing the scale from a non-default value. (#5794, #5833) - Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784) - Dev: Updated Conan dependencies. (#5776) +- Dev: Support Boost 1.87. (#5832) ## 2.5.2 diff --git a/lib/websocketpp b/lib/websocketpp index b9aeec6e..f1736a8e 160000 --- a/lib/websocketpp +++ b/lib/websocketpp @@ -1 +1 @@ -Subproject commit b9aeec6eaf3d5610503439b4fae3581d9aff08e8 +Subproject commit f1736a8e72b910810ff6869fe20f647a62f3bc35 diff --git a/src/controllers/sound/MiniaudioBackend.cpp b/src/controllers/sound/MiniaudioBackend.cpp index 3a88bbf3..1c5c611c 100644 --- a/src/controllers/sound/MiniaudioBackend.cpp +++ b/src/controllers/sound/MiniaudioBackend.cpp @@ -273,7 +273,7 @@ void MiniaudioBackend::play(const QUrl &sound) << "Failed to play default ping" << result; } - this->sleepTimer.expires_from_now(STOP_AFTER_DURATION); + this->sleepTimer.expires_after(STOP_AFTER_DURATION); this->sleepTimer.async_wait([this](const auto &ec) { if (ec) { diff --git a/src/providers/liveupdates/BasicPubSubManager.hpp b/src/providers/liveupdates/BasicPubSubManager.hpp index 299c84bc..e4c8f8f6 100644 --- a/src/providers/liveupdates/BasicPubSubManager.hpp +++ b/src/providers/liveupdates/BasicPubSubManager.hpp @@ -119,8 +119,9 @@ public: void start() { - this->work_ = std::make_shared( - this->websocketClient_.get_io_service()); + this->work_ = std::make_shared>( + this->websocketClient_.get_io_service().get_executor()); this->mainThread_.reset(new std::thread([this] { // make sure we set in any case, even exceptions auto guard = qScopeGuard([&] { @@ -409,7 +410,9 @@ private: std::atomic addingClient_{false}; ExponentialBackoff<5> connectBackoff_{std::chrono::milliseconds(1000)}; - std::shared_ptr work_{nullptr}; + std::shared_ptr> + work_{nullptr}; liveupdates::WebsocketClient websocketClient_; std::unique_ptr mainThread_; diff --git a/src/providers/twitch/PubSubHelpers.hpp b/src/providers/twitch/PubSubHelpers.hpp index faf01f4c..8f6ae124 100644 --- a/src/providers/twitch/PubSubHelpers.hpp +++ b/src/providers/twitch/PubSubHelpers.hpp @@ -14,11 +14,10 @@ struct ActionUser; // Create timer using given ioService template -void runAfter(boost::asio::io_service &ioService, Duration duration, - Callback cb) +void runAfter(boost::asio::io_context &ioc, Duration duration, Callback cb) { - auto timer = std::make_shared(ioService); - timer->expires_from_now(duration); + auto timer = std::make_shared(ioc); + timer->expires_after(duration); timer->async_wait([timer, cb](const boost::system::error_code &ec) { if (ec) @@ -37,7 +36,7 @@ template void runAfter(std::shared_ptr timer, Duration duration, Callback cb) { - timer->expires_from_now(duration); + timer->expires_after(duration); timer->async_wait([timer, cb](const boost::system::error_code &ec) { if (ec) diff --git a/src/providers/twitch/PubSubManager.cpp b/src/providers/twitch/PubSubManager.cpp index ba41a7b5..dd57a165 100644 --- a/src/providers/twitch/PubSubManager.cpp +++ b/src/providers/twitch/PubSubManager.cpp @@ -557,8 +557,9 @@ void PubSub::addClient() void PubSub::start() { - this->work = std::make_shared( - this->websocketClient.get_io_service()); + this->work = std::make_shared>( + this->websocketClient.get_io_service().get_executor()); this->thread = std::make_unique([this] { // make sure we set in any case, even exceptions auto guard = qScopeGuard([&] { diff --git a/src/providers/twitch/PubSubManager.hpp b/src/providers/twitch/PubSubManager.hpp index bfa22871..bb21e658 100644 --- a/src/providers/twitch/PubSubManager.hpp +++ b/src/providers/twitch/PubSubManager.hpp @@ -5,7 +5,7 @@ #include "util/ExponentialBackoff.hpp" #include "util/OnceFlag.hpp" -#include +#include #include #include #include @@ -263,7 +263,9 @@ private: void runThread(); - std::shared_ptr work{nullptr}; + std::shared_ptr> + work{nullptr}; const QString host_; const PubSubClientOptions clientOptions_;