From 0fb35e6e98bab89c6ba69f478b2c8160b22854cc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 10 Jan 2025 12:32:45 +0100 Subject: [PATCH] Don't use boost::asio::spawn() overload removed in Boost 1.87 --- lib/base/io-engine.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/base/io-engine.hpp b/lib/base/io-engine.hpp index a4a91393c1..005b3e6ae6 100644 --- a/lib/base/io-engine.hpp +++ b/lib/base/io-engine.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,10 @@ class IoEngine static void SpawnCoroutine(Handler& h, Function f) { boost::asio::spawn(h, +#if BOOST_VERSION >= 108700 + std::allocator_arg_t(), + boost::context::fixedsize_stack(GetCoroutineStackSize()), +#endif // BOOST_VERSION >= 108700 [f](boost::asio::yield_context yc) { try { @@ -116,8 +121,10 @@ class IoEngine // https://github.com/boostorg/coroutine/issues/39 throw; } - }, - boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size. + } +#if BOOST_VERSION < 108700 + , boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size. +#endif // BOOST_VERSION < 108700 ); }