60 lines
2.6 KiB
Diff
60 lines
2.6 KiB
Diff
From f4e5cc69aaa09f26f3dcd19f0e9db85b525b4b70 Mon Sep 17 00:00:00 2001
|
|
From: Brian Heim <brianlheim@gmail.com>
|
|
Date: Sun, 6 Oct 2019 18:39:38 -0500
|
|
Subject: [PATCH] supernova: fix compile errors with boost 1.71
|
|
|
|
class hierarchy changed. this change is at least backward compatible with 1.70
|
|
|
|
tested with boost 1.66, 1.71
|
|
---
|
|
server/supernova/sc/sc_osc_handler.cpp | 2 +-
|
|
server/supernova/sc/sc_osc_handler.hpp | 15 ++++++++++++---
|
|
2 files changed, 13 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/server/supernova/sc/sc_osc_handler.cpp b/server/supernova/sc/sc_osc_handler.cpp
|
|
index bf307fc13b..f1655946c2 100644
|
|
--- server/supernova/sc/sc_osc_handler.cpp
|
|
+++ server/supernova/sc/sc_osc_handler.cpp
|
|
@@ -734,7 +734,7 @@ void sc_osc_handler::tcp_connection::handle_message() {
|
|
|
|
|
|
void sc_osc_handler::start_tcp_accept(void) {
|
|
- tcp_connection::pointer new_connection = tcp_connection::create(tcp_acceptor_.get_executor().context());
|
|
+ tcp_connection::pointer new_connection = tcp_connection::create(tcp_acceptor_.get_executor());
|
|
|
|
tcp_acceptor_.async_accept(
|
|
new_connection->socket(),
|
|
diff --git a/server/supernova/sc/sc_osc_handler.hpp b/server/supernova/sc/sc_osc_handler.hpp
|
|
index 6a97774942..3d4bc6d2ff 100644
|
|
--- server/supernova/sc/sc_osc_handler.hpp
|
|
+++ server/supernova/sc/sc_osc_handler.hpp
|
|
@@ -226,9 +226,14 @@ class sc_osc_handler : private detail::network_thread, public sc_notify_observer
|
|
public:
|
|
class tcp_connection : public nova_endpoint {
|
|
public:
|
|
- typedef std::shared_ptr<tcp_connection> pointer;
|
|
+ using pointer = std::shared_ptr<tcp_connection>;
|
|
+#if BOOST_VERSION >= 107000
|
|
+ using executor = boost::asio::executor;
|
|
+#else
|
|
+ using executor = boost::asio::io_context::executor_type;
|
|
+#endif
|
|
|
|
- static pointer create(boost::asio::io_service& io_service) { return pointer(new tcp_connection(io_service)); }
|
|
+ static pointer create(const executor& executor) { return pointer(new tcp_connection(executor)); }
|
|
|
|
tcp::socket& socket() { return socket_; }
|
|
|
|
@@ -237,7 +242,11 @@ class sc_osc_handler : private detail::network_thread, public sc_notify_observer
|
|
bool operator==(tcp_connection const& rhs) const { return &rhs == this; }
|
|
|
|
private:
|
|
- tcp_connection(boost::asio::io_service& io_service): socket_(io_service) {}
|
|
+#if BOOST_VERSION >= 107000
|
|
+ tcp_connection(const executor& executor): socket_(executor) {}
|
|
+#else
|
|
+ tcp_connection(const executor& executor): socket_(executor.context()) {}
|
|
+#endif
|
|
|
|
void send(const char* data, size_t length) override final;
|
|
|