diff --git a/include/restc-cpp/restc-cpp.h b/include/restc-cpp/restc-cpp.h index 9f973bd..ef76416 100644 --- a/include/restc-cpp/restc-cpp.h +++ b/include/restc-cpp/restc-cpp.h @@ -57,6 +57,14 @@ throw; /* required for Boost Coroutine! */ \ } catch (...) +#if BOOST_VERSION >= 108100 +// They changed the function signature. In boost 1.86 it broke the build. +#define RESTC_CPP_SPAWN_TRAILER \ + , boost::asio::detached +#else +#define RESTC_CPP_SPAWN_TRAILER +#endif + namespace restc_cpp { class RestClient; @@ -421,7 +429,7 @@ class RestClient { prom->set_exception(std::current_exception()); } done_handler.reset(); - }, boost::asio::detached); + } RESTC_CPP_SPAWN_TRAILER); return future; } diff --git a/src/RestClientImpl.cpp b/src/RestClientImpl.cpp index 56e723a..f8cd8e5 100644 --- a/src/RestClientImpl.cpp +++ b/src/RestClientImpl.cpp @@ -342,7 +342,7 @@ class RestClientImpl final : public RestClient { void Process(const prc_fn_t& fn) override { boost::asio::spawn(*io_service_, bind(&RestClientImpl::ProcessInWorker, this, - placeholders::_1, fn, nullptr), boost::asio::detached); + placeholders::_1, fn, nullptr) RESTC_CPP_SPAWN_TRAILER); } future< void > ProcessWithPromise(const prc_fn_t& fn) override { @@ -351,7 +351,7 @@ class RestClientImpl final : public RestClient { boost::asio::spawn(*io_service_, bind(&RestClientImpl::ProcessInWorker, this, - placeholders::_1, fn, promise), boost::asio::detached); + placeholders::_1, fn, promise) RESTC_CPP_SPAWN_TRAILER); return future; }