mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-12-26 21:15:15 +00:00
Make code compatible with boost version 1.67
This commit is contained in:
parent
31c0976e7a
commit
810ff31c0e
@ -1,6 +1,13 @@
|
||||
//
|
||||
// Created by loki on 6/5/19.
|
||||
//
|
||||
#include <boost/version.hpp>
|
||||
#if ((BOOST_VERSION / 1000) >= 107)
|
||||
#define EXECUTOR(x) (x->get_executor())
|
||||
#else
|
||||
#define EXECUTOR(x) (x->get_io_service())
|
||||
#endif
|
||||
|
||||
|
||||
#include <queue>
|
||||
#include <iostream>
|
||||
@ -458,7 +465,7 @@ std::optional<udp::endpoint> recv_peer(udp::socket &sock) {
|
||||
|
||||
udp::endpoint peer;
|
||||
while (session.client_state > 0) {
|
||||
asio::deadline_timer timer { sock.get_executor() };
|
||||
asio::deadline_timer timer { EXECUTOR((&sock)) };
|
||||
timer.expires_from_now(boost::posix_time::seconds(2));
|
||||
timer.async_wait([&](sys::error_code c){
|
||||
sock.cancel();
|
||||
|
Loading…
Reference in New Issue
Block a user