Skip to content

Commit

Permalink
Don't use boost::asio::spawn() overload removed in Boost 1.87
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Jan 10, 2025
1 parent a9f993a commit 0fb35e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/base/io-engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <utility>
#include <vector>
#include <stdexcept>
#include <boost/context/fixedsize_stack.hpp>
#include <boost/exception/all.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/io_context.hpp>
Expand Down Expand Up @@ -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 {
Expand All @@ -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
);
}

Expand Down

0 comments on commit 0fb35e6

Please sign in to comment.