Skip to content

Commit fb8ebb8

Browse files
committed
Lower Boost_MINVERSION to 1.71.0 and add compatibility for older Boost versions
1 parent 336347d commit fb8ebb8

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎external/boost/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ target_compile_definitions(boost_websocket INTERFACE BOOST_ALL_NO_LIB)
77
# using only asio and beast
88
# handle Boost dependencies here only if not already handled by parent project
99
if (NOT TARGET Boost::beast)
10-
set(Boost_MINVERSION "1.90.0")
10+
set(Boost_MINVERSION "1.71.0")
1111
set(Boost_REQUIREDVERSION "1.90.0")
1212

1313
set(Boost_USE_MULTITHREADED ON)

‎src/async_reader.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ void AsyncReader::scheduleRead(const ReadTask& entryTask)
3131
assert(entryTask.getHandler() != nullptr);
3232
assert(entryTask.getSize() != 0);
3333
pendingTask = entryTask;
34+
35+
#if BOOST_VERSION >= 109000
3436
post(strand.wrap(
37+
#else
38+
ioContextRef.post(strand.wrap(
39+
#endif
3540
[this, shared_self = shared_from_this()]()
3641
{
3742
doRead(pendingTask.getSize());

‎src/async_writer.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ AsyncWriter::AsyncWriter(boost::asio::io_context& ioContextRef, std::shared_ptr<
1717

1818
void AsyncWriter::scheduleWrite(BatchedWriteTasks&& tasks, OptionalWriteDeadline&& deadlineTime)
1919
{
20+
#if BOOST_VERSION >= 109000
2021
post(strand.wrap(
22+
#else
23+
ioContextRef.post(strand.wrap(
24+
#endif
2125
[this, tasks = std::move(tasks), deadlineTime = std::move(deadlineTime), shared_self = shared_from_this()]() mutable
2226
{
2327
queueBatchWrite(std::move(tasks), std::move(deadlineTime));

0 commit comments

Comments
 (0)