Fixes for newer boost

develop
Jason Wenger 2020-05-12 21:53:21 -05:00
parent a4888526da
commit f01d90a692
3 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <functional>
#include <boost/asio.hpp>
#include <boost/core/noncopyable.hpp>
#include <f1x/aasdk/Error/Error.hpp>
#include <f1x/aasdk/IO/IOContextWrapper.hpp>

View File

@ -38,7 +38,12 @@ ServiceChannel::ServiceChannel(boost::asio::io_service::strand& strand,
void ServiceChannel::send(messenger::Message::Pointer message, SendPromise::Pointer promise)
{
#if BOOST_VERSION < 106600
auto sendPromise = messenger::SendPromise::defer(strand_.get_io_service());
#else
auto sendPromise = messenger::SendPromise::defer(strand_.context());
#endif
io::PromiseLink<>::forward(*sendPromise, std::move(promise));
messenger_->enqueueSend(std::move(message), std::move(sendPromise));
}

View File

@ -57,9 +57,15 @@ void AccessoryModeQueryChain::start(DeviceHandle handle, Promise::Pointer promis
promise_.reset();
});
#if BOOST_VERSION < 106600
this->startQuery(AccessoryModeQueryType::PROTOCOL_VERSION,
std::make_shared<USBEndpoint>(usbWrapper_, strand_.get_io_service(), std::move(handle)),
std::move(queryPromise));
#else
this->startQuery(AccessoryModeQueryType::PROTOCOL_VERSION,
std::make_shared<USBEndpoint>(usbWrapper_, strand_.context(), std::move(handle)),
std::move(queryPromise));
#endif
}
});
}