Merge pull request #662 from redboltz/update_boost_on_travis

Update boost on travis
This commit is contained in:
Takatoshi Kondo 2018-04-04 12:18:00 +09:00 committed by GitHub
commit 280abe852c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View File

@ -28,7 +28,7 @@ install:
# valgrind
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 && tar xjf valgrind-3.12.0.tar.bz2 && cd valgrind-3.12.0 && ./configure --prefix=${BASE}/usr > /dev/null && make -j3 > /dev/null && make install > /dev/null && cd ..; fi
# boost
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.zip && unzip -q boost_1_63_0.zip && cd boost_1_63_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.zip && unzip -q boost_1_66_0.zip && cd boost_1_66_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include; fi
matrix:

View File

@ -70,13 +70,22 @@ int main() {
// Client
auto host = "localhost";
boost::asio::ip::tcp::resolver r(ios);
#if BOOST_VERSION < 106600
boost::asio::ip::tcp::resolver::query q(host, boost::lexical_cast<std::string>(port));
auto it = r.resolve(q);
boost::asio::ip::tcp::resolver::iterator end;
#else // BOOST_VERSION < 106600
auto eps = r.resolve(host, boost::lexical_cast<std::string>(port));
auto it = eps.begin();
auto end = eps.end();
#endif // BOOST_VERSION < 106600
boost::asio::ip::tcp::socket cs(ios);
boost::asio::async_connect(
cs,
it,
end,
[&]
(boost::system::error_code const& e, boost::asio::ip::tcp::resolver::iterator) {
if (e) {

View File

@ -136,13 +136,24 @@ int main() {
// Client
auto host = "localhost";
boost::asio::ip::tcp::resolver r(ios);
#if BOOST_VERSION < 106600
boost::asio::ip::tcp::resolver::query q(host, boost::lexical_cast<std::string>(port));
auto it = r.resolve(q);
boost::asio::ip::tcp::resolver::iterator end;
#else // BOOST_VERSION < 106600
auto eps = r.resolve(host, boost::lexical_cast<std::string>(port));
auto it = eps.begin();
auto end = eps.end();
#endif // BOOST_VERSION < 106600
boost::asio::ip::tcp::socket cs(ios);
boost::asio::async_connect(
cs,
it,
end,
[&]
(boost::system::error_code const& e, boost::asio::ip::tcp::resolver::iterator) {
if (e) {