Skip to content

Commit cda826e

Browse files
gjasnydeanberris
authored andcommitted
Make compatible with boost::chrono
(this fixes two more places that 702dd54 missed)
1 parent 702dd54 commit cda826e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

boost/network/protocol/http/client/connection/sync_normal.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ struct http_sync_connection
7777
}
7878
}
7979
if (timeout_ > 0) {
80+
#if defined(BOOST_ASIO_HAS_STD_CHRONO)
8081
timer_.expires_from_now(std::chrono::seconds(timeout_));
82+
#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
83+
timer_.expires_from_now(boost::chrono::seconds(timeout_));
84+
#else
85+
#error Need a chrono implementation
86+
#endif
8187
auto self = this->shared_from_this();
8288
timer_.async_wait([=] (boost::system::error_code const &ec) {
8389
self->handle_timeout(ec);

boost/network/protocol/http/client/connection/sync_ssl.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ struct https_sync_connection
119119
}
120120
}
121121
if (timeout_ > 0) {
122+
#if defined(BOOST_ASIO_HAS_STD_CHRONO)
122123
timer_.expires_from_now(std::chrono::seconds(timeout_));
124+
#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
125+
timer_.expires_from_now(boost::chrono::seconds(timeout_));
126+
#else
127+
#error Need a chrono implementation
128+
#endif
123129
auto self = this->shared_from_this();
124130
timer_.async_wait(
125131
[=](boost::system::error_code const& ec) { self->handle_timeout(ec); });

0 commit comments

Comments
 (0)