Skip to content

Commit 5470ee3

Browse files
committed
Second take to fix the breaking change in boost 1.86
1 parent f6144b1 commit 5470ee3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

include/restc-cpp/restc-cpp.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
throw; /* required for Boost Coroutine! */ \
5858
} catch (...)
5959

60+
#if BOOST_VERSION >= 108100
61+
// They changed the function signature. In boost 1.86 it broke the build.
62+
#define RESTC_CPP_SPAWN_TRAILER \
63+
, boost::asio::detached
64+
#else
65+
#define RESTC_CPP_SPAWN_TRAILER
66+
#endif
67+
6068
namespace restc_cpp {
6169

6270
class RestClient;
@@ -421,7 +429,7 @@ class RestClient {
421429
prom->set_exception(std::current_exception());
422430
}
423431
done_handler.reset();
424-
}, boost::asio::detached);
432+
} RESTC_CPP_SPAWN_TRAILER);
425433

426434
return future;
427435
}

src/RestClientImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class RestClientImpl final : public RestClient {
342342
void Process(const prc_fn_t& fn) override {
343343
boost::asio::spawn(*io_service_,
344344
bind(&RestClientImpl::ProcessInWorker, this,
345-
placeholders::_1, fn, nullptr), boost::asio::detached);
345+
placeholders::_1, fn, nullptr) RESTC_CPP_SPAWN_TRAILER);
346346
}
347347

348348
future< void > ProcessWithPromise(const prc_fn_t& fn) override {
@@ -351,7 +351,7 @@ class RestClientImpl final : public RestClient {
351351

352352
boost::asio::spawn(*io_service_,
353353
bind(&RestClientImpl::ProcessInWorker, this,
354-
placeholders::_1, fn, promise), boost::asio::detached);
354+
placeholders::_1, fn, promise) RESTC_CPP_SPAWN_TRAILER);
355355

356356
return future;
357357
}

0 commit comments

Comments
 (0)