Skip to content

Commit 1af7949

Browse files
committed
build: require boost >= 1.71.0
Refs: #5276 Change-Id: I287a52dab0212d1ce0da77afb563554214cac68a
1 parent 9330c2e commit 1af7949

File tree

8 files changed

+28
-22
lines changed

8 files changed

+28
-22
lines changed

src/interest-table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2012-2019 University of California, Los Angeles
3+
* Copyright (c) 2012-2023 University of California, Los Angeles
44
*
55
* This file is part of ChronoSync, synchronization library for distributed realtime
66
* applications for NDN.
@@ -26,7 +26,7 @@
2626

2727
namespace chronosync {
2828

29-
InterestTable::InterestTable(boost::asio::io_service& io)
29+
InterestTable::InterestTable(boost::asio::io_context& io)
3030
: m_scheduler(io)
3131
{
3232
}

src/interest-table.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2012-2021 University of California, Los Angeles
3+
* Copyright (c) 2012-2023 University of California, Los Angeles
44
*
55
* This file is part of ChronoSync, synchronization library for distributed realtime
66
* applications for NDN.
@@ -27,12 +27,12 @@
2727

2828
#include "interest-container.hpp"
2929

30-
#include <boost/asio/io_service.hpp>
30+
#include <boost/asio/io_context.hpp>
3131

3232
namespace chronosync {
3333

3434
/**
35-
* @brief A table to keep unsatisfied Sync Interest
35+
* @brief A table to keep unsatisfied Sync Interests.
3636
*/
3737
class InterestTable : noncopyable
3838
{
@@ -47,7 +47,7 @@ class InterestTable : noncopyable
4747
using const_iterator = InterestContainer::const_iterator;
4848

4949
explicit
50-
InterestTable(boost::asio::io_service& io);
50+
InterestTable(boost::asio::io_context& io);
5151

5252
~InterestTable();
5353

tests/unit-test-time-fixture.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2012-2022 University of California, Los Angeles
3+
* Copyright (c) 2012-2023 University of California, Los Angeles
44
*
55
* This file is part of ChronoSync, synchronization library for distributed realtime
66
* applications for NDN.
@@ -22,7 +22,7 @@
2222

2323
#include <ndn-cxx/util/time-unit-test-clock.hpp>
2424

25-
#include <boost/asio.hpp>
25+
#include <boost/asio/io_context.hpp>
2626

2727
namespace ndn::tests {
2828

@@ -42,22 +42,23 @@ class UnitTestTimeFixture
4242
}
4343

4444
void
45-
advanceClocks(const time::nanoseconds& tick, size_t nTicks = 1)
45+
advanceClocks(time::nanoseconds tick, size_t nTicks = 1)
4646
{
4747
for (size_t i = 0; i < nTicks; ++i) {
4848
steadyClock->advance(tick);
4949
systemClock->advance(tick);
5050

51-
if (io.stopped())
52-
io.reset();
51+
if (io.stopped()) {
52+
io.restart();
53+
}
5354
io.poll();
5455
}
5556
}
5657

5758
public:
5859
shared_ptr<time::UnitTestSteadyClock> steadyClock;
5960
shared_ptr<time::UnitTestSystemClock> systemClock;
60-
boost::asio::io_service io;
61+
boost::asio::io_context io;
6162
};
6263

6364
} // namespace ndn::tests

tests/unit-tests/dummy-forwarder.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919

2020
#include "dummy-forwarder.hpp"
2121

22-
#include <boost/asio/io_service.hpp>
22+
#include <boost/asio/io_context.hpp>
23+
#include <boost/asio/post.hpp>
2324

2425
namespace ndn {
2526
namespace chronosync {
2627

27-
DummyForwarder::DummyForwarder(boost::asio::io_service& io, KeyChain& keyChain)
28+
DummyForwarder::DummyForwarder(boost::asio::io_context& io, KeyChain& keyChain)
2829
: m_io(io)
2930
, m_keyChain(keyChain)
3031
{
@@ -42,7 +43,7 @@ DummyForwarder::addFace()
4243
if (self == &*otherFace) {
4344
continue;
4445
}
45-
m_io.post([=] { otherFace->receive(i); });
46+
boost::asio::post(m_io, [=] { otherFace->receive(i); });
4647
}
4748
});
4849

@@ -52,7 +53,7 @@ DummyForwarder::addFace()
5253
if (self == &*otherFace) {
5354
continue;
5455
}
55-
m_io.post([=] { otherFace->receive(d); });
56+
boost::asio::post(m_io, [=] { otherFace->receive(d); });
5657
}
5758
});
5859

@@ -62,7 +63,7 @@ DummyForwarder::addFace()
6263
if (self == &*otherFace) {
6364
continue;
6465
}
65-
m_io.post([=] { otherFace->receive(n); });
66+
boost::asio::post(m_io, [=] { otherFace->receive(n); });
6667
}
6768
});
6869

tests/unit-tests/dummy-forwarder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace chronosync {
3838
class DummyForwarder
3939
{
4040
public:
41-
DummyForwarder(boost::asio::io_service& io, KeyChain& keyChain);
41+
DummyForwarder(boost::asio::io_context& io, KeyChain& keyChain);
4242

4343
Face&
4444
addFace();
@@ -53,7 +53,7 @@ class DummyForwarder
5353
removeFaces();
5454

5555
private:
56-
boost::asio::io_service& m_io;
56+
boost::asio::io_context& m_io;
5757
KeyChain& m_keyChain;
5858
std::vector<std::shared_ptr<DummyClientFace>> m_faces;
5959
};

tests/unit-tests/test-logic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ BOOST_AUTO_TEST_CASE(CancelOutstandingEvents)
363363
systemClock->advance(ndn::time::hours(1));
364364

365365
BOOST_CHECK_EQUAL(io.poll(), 0); // no delayed handlers are expected
366-
BOOST_CHECK_EQUAL(io.stopped(), true); // io_service expected to be stopped
366+
BOOST_CHECK_EQUAL(io.stopped(), true); // io_context expected to be stopped
367367
}
368368

369369
BOOST_FIXTURE_TEST_CASE(TrimState, ndn::tests::IdentityManagementTimeFixture)

tests/unit-tests/test-multiple-user.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2012-2022 University of California, Los Angeles
3+
* Copyright (c) 2012-2023 University of California, Los Angeles
44
*
55
* This file is part of ChronoSync, synchronization library for distributed realtime
66
* applications for NDN.
@@ -72,7 +72,7 @@ class MultiUserFixture
7272
Name syncPrefix;
7373
Name userPrefix[3];
7474

75-
boost::asio::io_service io;
75+
boost::asio::io_context io;
7676
shared_ptr<ndn::Face> face;
7777
ndn::Scheduler scheduler;
7878
shared_ptr<Handler> handler;

wscript

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ def configure(conf):
3838
uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
3939

4040
conf.check_boost(lib='iostreams', mt=True)
41+
if conf.env.BOOST_VERSION_NUMBER < 107100:
42+
conf.fatal('The minimum supported version of Boost is 1.71.0.\n'
43+
'Please upgrade your distribution or manually install a newer version of Boost.\n'
44+
'For more information, see https://redmine.named-data.net/projects/nfd/wiki/Boost')
4145

4246
if conf.env.WITH_TESTS:
4347
conf.check_boost(lib='filesystem unit_test_framework', mt=True, uselib_store='BOOST_TESTS')

0 commit comments

Comments
 (0)