build: require gcc >= 5.3, boost >= 1.58, openssl >= 1.0.2
This effectively drops support for all versions of Ubuntu older than 16.04
Change-Id: Ie3ab7df9147e97f6467658a6399a4f9379f089c1
Refs: #4462
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
index f6e3167..a69ef9e 100644
--- a/.jenkins.d/README.md
+++ b/.jenkins.d/README.md
@@ -13,13 +13,13 @@
* `[OS_TYPE]`: `Linux`
* `[DISTRO_TYPE]`: `Ubuntu`
- * `[DISTRO_VERSION]`: `Ubuntu-14.04`, `Ubuntu-16.04`
+ * `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
Possible values for OS X / macOS:
* `[OS_TYPE]`: `OSX`
* `[DISTRO_TYPE]`: `OSX` (can be absent)
- * `[DISTRO_VERSION]`: `OSX-10.10`, `OSX-10.11`, `OSX-10.12`
+ * `[DISTRO_VERSION]`: `OSX-10.11`, `OSX-10.12`, `OSX-10.13`
- `JOB_NAME`: optional variable to define type of the job. Depending on the defined job type,
the build scripts can perform different tasks.
diff --git a/.travis.yml b/.travis.yml
index bc71186..fb2ec6f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: cpp
-dist: trusty
+dist: xenial
sudo: required
env:
global:
@@ -11,92 +11,34 @@
# Linux/gcc
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/+packages
- os: linux
- env: COMPILER=g++-4.8
- - os: linux
- env: COMPILER=g++-4.9
- addons:
- apt:
- sources: ubuntu-toolchain-r-test
- packages: g++-4.9
- - os: linux
env: COMPILER=g++-5
- addons:
- apt:
- sources: ubuntu-toolchain-r-test
- packages: g++-5
- os: linux
env: COMPILER=g++-6
- addons:
- apt:
- sources: ubuntu-toolchain-r-test
- packages: g++-6
- os: linux
env: COMPILER=g++-7
- addons:
- apt:
- sources: ubuntu-toolchain-r-test
- packages: g++-7
- os: linux
env: COMPILER=g++-8
- addons:
- apt:
- sources: ubuntu-toolchain-r-test
- packages: g++-8
# Linux/clang
# https://apt.llvm.org/
- os: linux
env: COMPILER=clang++-3.5
- addons:
- apt:
- packages: clang-3.5
- os: linux
env: COMPILER=clang++-3.6
- addons:
- apt:
- packages: clang-3.6
- os: linux
env: COMPILER=clang++-3.7 DISABLE_ASAN=yes
- addons:
- apt:
- sources: ["llvm-toolchain-precise-3.7", "ubuntu-toolchain-r-test"]
- packages: clang-3.7
- os: linux
env: COMPILER=clang++-3.8
- addons:
- apt:
- sources: ["llvm-toolchain-precise-3.8", "ubuntu-toolchain-r-test"]
- packages: clang-3.8
- os: linux
- env: COMPILER=clang++-3.9 DISABLE_ASAN=yes
- addons:
- apt:
- sources: ["llvm-toolchain-trusty-3.9", "ubuntu-toolchain-r-test"]
- packages: clang-3.9
+ env: COMPILER=clang++-3.9
- os: linux
env: COMPILER=clang++-4.0
- addons:
- apt:
- sources: ["llvm-toolchain-trusty-4.0", "ubuntu-toolchain-r-test"]
- packages: clang-4.0
- os: linux
env: COMPILER=clang++-5.0
- addons:
- apt:
- sources: ["llvm-toolchain-trusty-5.0", "ubuntu-toolchain-r-test"]
- packages: clang-5.0
- os: linux
env: COMPILER=clang++-6.0
- addons:
- apt:
- sources: ["llvm-toolchain-trusty-6.0", "ubuntu-toolchain-r-test"]
- packages: clang-6.0
- os: linux
env: COMPILER=clang++-7
- addons:
- apt:
- sources: ["llvm-toolchain-trusty", "ubuntu-toolchain-r-test"]
- packages: clang-7
# macOS/clang
# https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
@@ -114,13 +56,40 @@
env: OSX_VERSION=10.13 USE_OPENSSL_1_1=yes
allow_failures:
+ - env: COMPILER=g++-6
+ - env: COMPILER=g++-7
+ - env: COMPILER=g++-8
+ - env: COMPILER=clang++-3.5
+ - env: COMPILER=clang++-3.6
+ - env: COMPILER=clang++-3.7 DISABLE_ASAN=yes
+ - env: COMPILER=clang++-4.0
+ - env: COMPILER=clang++-5.0
+ - env: COMPILER=clang++-6.0
- env: COMPILER=clang++-7
- env: OSX_VERSION=10.13 USE_OPENSSL_1_1=yes
fast_finish: true
+install: |
+ case ${COMPILER} in
+ g++-[6789])
+ travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ travis_retry sudo apt-get -qq update
+ travis_retry sudo apt-get -qy install "${COMPILER}"
+ ;;
+ clang++-*)
+ CLANG_VERSION=${COMPILER/clang++}
+ if [[ ${CLANG_VERSION} != "-3."* ]]; then
+ wget -O - "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
+ travis_retry sudo add-apt-repository -y "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial${CLANG_VERSION/-7} main"
+ fi
+ travis_retry sudo apt-get -qq update
+ travis_retry sudo apt-get -qy install "clang${CLANG_VERSION}"
+ ;;
+ esac
+
before_script:
- - if [[ ${TRAVIS_OS_NAME} == linux ]]; then export NODE_LABELS="Linux Ubuntu Ubuntu-14.04"; fi
+ - if [[ ${TRAVIS_OS_NAME} == linux ]]; then export NODE_LABELS="Linux Ubuntu Ubuntu-16.04"; fi
- if [[ ${TRAVIS_OS_NAME} == osx ]]; then export NODE_LABELS="OSX OSX-${OSX_VERSION}"; fi
- if [[ -n ${COMPILER} ]]; then export CXX=${COMPILER}; fi
- ${CXX:-c++} --version
diff --git a/.waf-tools/compiler-features.py b/.waf-tools/compiler-features.py
index 502596c..1602f16 100644
--- a/.waf-tools/compiler-features.py
+++ b/.waf-tools/compiler-features.py
@@ -23,31 +23,8 @@
@conf
def check_std_to_string(self):
if self.check_cxx(msg='Checking for std::to_string',
- fragment=STD_TO_STRING,
- features='cxx', mandatory=False):
+ fragment=STD_TO_STRING, mandatory=False):
self.define('HAVE_STD_TO_STRING', 1)
-VECTOR_INSERT_ERASE_CONST_ITERATOR = '''
-#include <vector>
-int
-main()
-{
- std::vector<int> v;
- std::vector<int>::const_iterator it = v.cbegin();
-
- v.insert(it, 2);
- it = v.cend() - 1;
- v.erase(it);
-}
-'''
-
-@conf
-def check_vector_const_iterators(self):
- if self.check_cxx(msg='Checking for std::vector::insert with const_iterator',
- fragment=VECTOR_INSERT_ERASE_CONST_ITERATOR,
- features='cxx', mandatory=False):
- self.define('HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR', 1)
-
def configure(conf):
conf.check_std_to_string()
- conf.check_vector_const_iterators()
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 54db7ea..e9fdcc6 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -15,14 +15,14 @@
errmsg = ''
warnmsg = ''
if cxx == 'gcc':
- if ccver < (4, 8, 2):
+ if ccver < (5, 3, 0):
errmsg = ('The version of gcc you are using is too old.\n'
- 'The minimum supported gcc version is 4.8.2.')
+ 'The minimum supported gcc version is 5.3.0.')
conf.flags = GccFlags()
elif cxx == 'clang':
- if ccver < (3, 4, 0):
+ if ccver < (3, 5, 0):
errmsg = ('The version of clang you are using is too old.\n'
- 'The minimum supported clang version is 3.4.0.')
+ 'The minimum supported clang version is 3.5.0.')
conf.flags = ClangFlags()
else:
warnmsg = 'Note: %s compiler is unsupported' % cxx
@@ -164,16 +164,12 @@
class GccFlags(GccBasicFlags):
def getDebugFlags(self, conf):
flags = super(GccFlags, self).getDebugFlags(conf)
- if self.getCompilerVersion(conf) < (5, 1, 0):
- flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
- flags['CXXFLAGS'] += ['-fdiagnostics-color'] # gcc >= 4.9
+ flags['CXXFLAGS'] += ['-fdiagnostics-color']
return flags
def getOptimizedFlags(self, conf):
flags = super(GccFlags, self).getOptimizedFlags(conf)
- if self.getCompilerVersion(conf) < (5, 1, 0):
- flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
- flags['CXXFLAGS'] += ['-fdiagnostics-color'] # gcc >= 4.9
+ flags['CXXFLAGS'] += ['-fdiagnostics-color']
return flags
class ClangFlags(GccBasicFlags):
diff --git a/.waf-tools/type_traits.py b/.waf-tools/type_traits.py
deleted file mode 100644
index efc4e3d..0000000
--- a/.waf-tools/type_traits.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-def checkForTypeProperty(conf, prop, tparams):
- if conf.check_cxx(msg=('Checking for std::%s' % prop),
- fragment=('#include <type_traits>\nstatic_assert(std::%s<%s>::value, "");' %
- (prop, tparams)),
- features='cxx', mandatory=False):
- define = 'HAVE_' + prop.upper()
- conf.define(define, 1)
- conf.env[define] = True
-
-def configure(conf):
- checkForTypeProperty(conf, 'is_default_constructible', 'int')
- checkForTypeProperty(conf, 'is_nothrow_move_constructible', 'int')
- checkForTypeProperty(conf, 'is_nothrow_move_assignable', 'int')
diff --git a/README-dev.md b/README-dev.md
index d9af4c9..8dd53d1 100644
--- a/README-dev.md
+++ b/README-dev.md
@@ -63,7 +63,7 @@
./build/unit-tests
-[Boost.Test framework](http://www.boost.org/doc/libs/1_54_0/libs/test/doc/html/index.html)
+[Boost.Test framework](https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/index.html)
is very flexible and allows a number of run-time customization of what tests should be run.
For example, it is possible to choose to run only a specific test suite, only a specific
test case within a suite, or specific test cases within specific test suites:
@@ -96,7 +96,7 @@
There are many more command line options available, information about which can be obtained
either from the command line using `--help` switch, or online on
-[Boost.Test library](http://www.boost.org/doc/libs/1_54_0/libs/test/doc/html/index.html)
+[Boost.Test library](https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/index.html)
website.
**Warning:** If you have customized parameters for NDN platform using `client.conf` in
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index 019ed5b..0eaf52a 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -9,7 +9,6 @@
ndn-cxx uses continuous integration and has been tested on the following
platforms:
-- Ubuntu 14.04 (amd64)
- Ubuntu 16.04 (amd64, armhf, i386)
- Ubuntu 18.04 (amd64)
- OS X 10.11
@@ -30,11 +29,12 @@
Required:
~~~~~~~~~
+- GCC >= 5.3, or clang >= 3.5
- ``python2`` >= 2.7, or ``python3`` >= 3.4
- ``libsqlite3``
-- OpenSSL >= 1.0.1
+- OpenSSL >= 1.0.2
- ``pkg-config``
-- Boost libraries >= 1.54
+- Boost libraries >= 1.58
- OSX Security framework (on OSX/macOS platform only)
Following are the detailed steps for each platform to install the compiler, all necessary
diff --git a/docs/code-style.rst b/docs/code-style.rst
index 1450598..bf0ffee 100644
--- a/docs/code-style.rst
+++ b/docs/code-style.rst
@@ -1087,6 +1087,6 @@
3.31. The recommended way to throw an exception derived from ``std::exception`` is to use
the ``BOOST_THROW_EXCEPTION``
-`macro <http://www.boost.org/doc/libs/1_54_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html>`__.
+`macro <https://www.boost.org/doc/libs/1_58_0/libs/exception/doc/BOOST_THROW_EXCEPTION.html>`__.
Exceptions thrown using this macro will be augmented with additional diagnostic information,
including file name, line number, and function name from where the exception was thrown.
diff --git a/docs/examples.rst b/docs/examples.rst
index 8689e4f..729a6c5 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -52,7 +52,7 @@
events for execution at specific points of time.
The library internally uses `boost::asio::io_service
-<http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/io_service.html>`_ to
+<https://www.boost.org/doc/libs/1_58_0/doc/html/boost_asio/reference/io_service.html>`_ to
implement fully asynchronous NDN operations (i.e., sending and receiving Interests and
Data). In addition to network-related operations, ``boost::asio::io_service`` can be used
to execute any arbitrary callback within the processing thread (run either explicitly via
diff --git a/docs/tutorials/utils-ndn-regex.rst b/docs/tutorials/utils-ndn-regex.rst
index 6492a96..af107c0 100644
--- a/docs/tutorials/utils-ndn-regex.rst
+++ b/docs/tutorials/utils-ndn-regex.rst
@@ -6,7 +6,7 @@
A name component matcher, enclosed in ``<`` and ``>``, specifies the pattern of a name component. The
component pattern is expressed with the `Perl Regular Expression Syntax
-<http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html>`__.
+<https://www.boost.org/doc/libs/1_58_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html>`__.
For example, ``<ab*c>`` matches the 1st, 3rd, and 4th components of ``/ac/dc/abc/abbc``, but does
not match the 2nd component. A special case is that ``<>`` denotes a wildcard matcher that can match
**ANY** name component.
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index 2113064..ed8f5c9 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -34,15 +34,10 @@
namespace ndn {
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Block>));
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
static_assert(std::is_nothrow_move_constructible<Block>::value,
"Block must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
-
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
static_assert(std::is_nothrow_move_assignable<Block>::value,
"Block must be MoveAssignable with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
const size_t MAX_SIZE_OF_BLOCK_FROM_STREAM = MAX_NDN_PACKET_SIZE;
@@ -454,30 +449,14 @@
Block::erase(Block::element_const_iterator position)
{
resetWire();
-
-#ifdef NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR
return m_elements.erase(position);
-#else
- element_iterator it = m_elements.begin();
- std::advance(it, std::distance(m_elements.cbegin(), position));
- return m_elements.erase(it);
-#endif
}
Block::element_iterator
Block::erase(Block::element_const_iterator first, Block::element_const_iterator last)
{
resetWire();
-
-#ifdef NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR
return m_elements.erase(first, last);
-#else
- element_iterator itStart = m_elements.begin();
- element_iterator itEnd = m_elements.begin();
- std::advance(itStart, std::distance(m_elements.cbegin(), first));
- std::advance(itEnd, std::distance(m_elements.cbegin(), last));
- return m_elements.erase(itStart, itEnd);
-#endif
}
void
@@ -491,14 +470,7 @@
Block::insert(Block::element_const_iterator pos, const Block& element)
{
resetWire();
-
-#ifdef NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR
return m_elements.insert(pos, element);
-#else
- element_iterator it = m_elements.begin();
- std::advance(it, std::distance(m_elements.cbegin(), pos));
- return m_elements.insert(it, element);
-#endif
}
// ---- misc ----
diff --git a/src/encoding/buffer.cpp b/src/encoding/buffer.cpp
index ce4c880..531e9fa 100644
--- a/src/encoding/buffer.cpp
+++ b/src/encoding/buffer.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,15 +25,10 @@
namespace ndn {
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
static_assert(std::is_nothrow_move_constructible<Buffer>::value,
"Buffer must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
-
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
static_assert(std::is_nothrow_move_assignable<Buffer>::value,
"Buffer must be MoveAssignable with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE
Buffer::Buffer() = default;
diff --git a/src/net/address-converter.cpp b/src/net/address-converter.cpp
index d84f757..e29c0c0 100644
--- a/src/net/address-converter.cpp
+++ b/src/net/address-converter.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California,
+ * Copyright (c) 2013-2018 Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,13 +27,7 @@
#include "address-converter.hpp"
-#if BOOST_VERSION < 105800
-#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
-#include <vector>
-#endif // BOOST_VERSION < 105800
-
-#include <net/if.h> // for if_nametoindex and if_indextoname
+#include <net/if.h> // for if_indextoname()
namespace ndn {
namespace ip {
@@ -49,69 +43,10 @@
return nullopt;
}
-#if BOOST_VERSION < 105800
-static unsigned int
-scopeIdFromString(const std::string& scope)
-{
- auto id = if_nametoindex(scope.c_str());
- if (id != 0) {
- return id;
- }
-
- // cannot find a corresponding index, assume it's not a name but an interface index
- try {
- return boost::lexical_cast<unsigned int>(scope);
- }
- catch (const boost::bad_lexical_cast&) {
- return 0;
- }
-}
-
-struct ParsedAddress
-{
- boost::asio::ip::address addr;
- std::string scope;
-};
-
-static ParsedAddress
-parseAddressFromString(const std::string& address, boost::system::error_code& ec)
-{
- std::vector<std::string> parseResult;
- boost::algorithm::split(parseResult, address, boost::is_any_of("%"));
- auto addr = boost::asio::ip::address::from_string(parseResult[0], ec);
-
- switch (parseResult.size()) {
- case 1:
- // regular address
- return {addr, ""};
- case 2:
- // the presence of % in either an IPv4 address or a regular IPv6 address is invalid
- if (!ec && addr.is_v6() && addr.to_v6().is_link_local()) {
- return {addr, parseResult[1]};
- }
- NDN_CXX_FALLTHROUGH;
- default:
- ec = boost::asio::error::invalid_argument;
- return {};
- }
-}
-#endif // BOOST_VERSION < 105800
-
boost::asio::ip::address
addressFromString(const std::string& address, boost::system::error_code& ec)
{
- // boost < 1.58 cannot recognize scope-id in link-local IPv6 address
-#if BOOST_VERSION < 105800
- auto parsedAddress = parseAddressFromString(address, ec);
- if (ec || parsedAddress.addr.is_v4()) {
- return parsedAddress.addr;
- }
- auto addr = parsedAddress.addr.to_v6();
- addr.scope_id(scopeIdFromString(parsedAddress.scope));
- return addr;
-#else
return boost::asio::ip::address::from_string(address, ec);
-#endif // BOOST_VERSION < 105800
}
boost::asio::ip::address
diff --git a/src/security/transform/verifier-filter.cpp b/src/security/transform/verifier-filter.cpp
index fca982a..f4b8e84 100644
--- a/src/security/transform/verifier-filter.cpp
+++ b/src/security/transform/verifier-filter.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -75,13 +75,7 @@
void
VerifierFilter::finalize()
{
- int res = EVP_DigestVerifyFinal(m_impl->ctx,
-#if OPENSSL_VERSION_NUMBER < 0x1000200fL
- const_cast<uint8_t*>(m_impl->sig),
-#else
- m_impl->sig,
-#endif
- m_impl->siglen);
+ int res = EVP_DigestVerifyFinal(m_impl->ctx, m_impl->sig, m_impl->siglen);
auto buffer = make_unique<OBuffer>(1);
(*buffer)[0] = (res == 1) ? 1 : 0;
diff --git a/src/util/backports-optional.hpp b/src/util/backports-optional.hpp
index accae69..73e1068 100644
--- a/src/util/backports-optional.hpp
+++ b/src/util/backports-optional.hpp
@@ -107,18 +107,7 @@
};
constexpr nullopt_t nullopt{0};
-#if BOOST_VERSION >= 105600
using boost::bad_optional_access;
-#else
-class bad_optional_access : public std::logic_error
-{
-public:
- bad_optional_access()
- : std::logic_error("bad optional access")
- {
- }
-};
-#endif
template<typename T>
constexpr bool
@@ -241,25 +230,14 @@
T&
value()
{
-#if BOOST_VERSION >= 105600
return m_boostOptional.value();
-#else
- if (!m_boostOptional) {
- BOOST_THROW_EXCEPTION(bad_optional_access());
- }
- return m_boostOptional.get();
-#endif
}
template<typename U>
constexpr T
value_or(U&& default_value) const
{
-#if BOOST_VERSION >= 105600
return m_boostOptional.value_or(default_value);
-#else
- return m_boostOptional.get_value_or(default_value);
-#endif
}
public: // modifiers
diff --git a/src/util/regex/regex-component-matcher.cpp b/src/util/regex/regex-component-matcher.cpp
index 8d1e824..aca35c1 100644
--- a/src/util/regex/regex-component-matcher.cpp
+++ b/src/util/regex/regex-component-matcher.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -26,19 +26,6 @@
namespace ndn {
-// Re: http://www.boost.org/users/history/version_1_56_0.html
-//
-// Breaking change: corrected behavior of basic_regex<>::mark_count() to match existing
-// documentation, basic_regex<>::subexpression(n) changed to match, see
-// https://svn.boost.org/trac/boost/ticket/9227
-//
-static constexpr size_t BOOST_REGEXP_MARK_COUNT_CORRECTION =
-#if BOOST_VERSION < 105600
- 1;
-#else
- 0;
-#endif
-
RegexComponentMatcher::RegexComponentMatcher(const std::string& expr,
shared_ptr<RegexBackrefManager> backrefManager,
bool isExactMatch)
@@ -56,7 +43,7 @@
m_pseudoMatchers.clear();
m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
- for (size_t i = 1; i <= m_componentRegex.mark_count() - BOOST_REGEXP_MARK_COUNT_CORRECTION; i++) {
+ for (size_t i = 1; i <= m_componentRegex.mark_count(); i++) {
m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
m_backrefManager->pushRef(m_pseudoMatchers.back());
}
@@ -78,7 +65,7 @@
boost::smatch subResult;
std::string targetStr = name.get(offset).toUri();
if (boost::regex_match(targetStr, subResult, m_componentRegex)) {
- for (size_t i = 1; i <= m_componentRegex.mark_count() - BOOST_REGEXP_MARK_COUNT_CORRECTION; i++) {
+ for (size_t i = 1; i <= m_componentRegex.mark_count(); i++) {
m_pseudoMatchers[i]->resetMatchResult();
m_pseudoMatchers[i]->setMatchResult(subResult[i]);
}
diff --git a/src/util/scheduler-scoped-event-id.cpp b/src/util/scheduler-scoped-event-id.cpp
index f5378c8..0ca7d13 100644
--- a/src/util/scheduler-scoped-event-id.cpp
+++ b/src/util/scheduler-scoped-event-id.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,10 +25,8 @@
namespace util {
namespace scheduler {
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
static_assert(std::is_nothrow_move_constructible<ScopedEventId>::value,
"ScopedEventId must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
ScopedEventId::ScopedEventId(Scheduler& scheduler)
: m_scheduler(&scheduler)
diff --git a/src/util/signal/scoped-connection.cpp b/src/util/signal/scoped-connection.cpp
index cbbfaba..3fed4a3 100644
--- a/src/util/signal/scoped-connection.cpp
+++ b/src/util/signal/scoped-connection.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,14 +25,10 @@
namespace util {
namespace signal {
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
static_assert(std::is_nothrow_move_constructible<ScopedConnection>::value,
"ScopedConnection must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
-ScopedConnection::ScopedConnection()
-{
-}
+ScopedConnection::ScopedConnection() = default;
ScopedConnection::ScopedConnection(const Connection& connection)
: m_connection(connection)
diff --git a/src/util/signal/signal.hpp b/src/util/signal/signal.hpp
index 9b502ab..8c76e13 100644
--- a/src/util/signal/signal.hpp
+++ b/src/util/signal/signal.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,6 +23,7 @@
#define NDN_UTIL_SIGNAL_SIGNAL_HPP
#include "connection.hpp"
+
#include <list>
namespace ndn {
@@ -163,7 +164,7 @@
Connection
Signal<Owner, TArgs...>::connect(const Handler& handler)
{
- typename SlotList::iterator it = m_slots.insert(m_slots.end(), {handler, nullptr});
+ auto it = m_slots.insert(m_slots.end(), {handler, nullptr});
it->disconnect = make_shared<function<void()>>(bind(&Self::disconnect, this, it));
return signal::Connection(weak_ptr<function<void()>>(it->disconnect));
@@ -173,7 +174,7 @@
Connection
Signal<Owner, TArgs...>::connectSingleShot(const Handler& handler)
{
- typename SlotList::iterator it = m_slots.insert(m_slots.end(), {nullptr, nullptr});
+ auto it = m_slots.insert(m_slots.end(), {nullptr, nullptr});
it->disconnect = make_shared<function<void()>>(bind(&Self::disconnect, this, it));
signal::Connection conn(weak_ptr<function<void()>>(it->disconnect));
@@ -189,8 +190,6 @@
void
Signal<Owner, TArgs...>::disconnect(typename SlotList::iterator it)
{
- // 'it' could be const_iterator, but gcc 4.6 doesn't support std::list::erase(const_iterator)
-
if (m_isExecuting) {
// during signal emission, only the currently executing handler can be disconnected
BOOST_ASSERT_MSG(it == m_currentSlot, "cannot disconnect another handler from a handler");
diff --git a/src/util/time.hpp b/src/util/time.hpp
index cf497af..0d1250d 100644
--- a/src/util/time.hpp
+++ b/src/util/time.hpp
@@ -303,7 +303,7 @@
* \param format desired output format (default: `%Y-%m-%d %H:%M:%S`)
* \param locale desired locale (default: "C" locale)
*
- * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
+ * \sa https://www.boost.org/doc/libs/1_58_0/doc/html/date_time/date_time_io.html#date_time.format_flags
* describes possible formatting flags
**/
std::string
@@ -321,7 +321,7 @@
* \param format input output format (default: `%Y-%m-%d %H:%M:%S`)
* \param locale input locale (default: "C" locale)
*
- * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
+ * \sa https://www.boost.org/doc/libs/1_58_0/doc/html/date_time/date_time_io.html#date_time.format_flags
* describes possible formatting flags
*/
system_clock::TimePoint
diff --git a/wscript b/wscript
index 96740c3..f37418d 100644
--- a/wscript
+++ b/wscript
@@ -11,7 +11,7 @@
def options(opt):
opt.load(['compiler_cxx', 'gnu_dirs', 'c_osx'])
- opt.load(['default-compiler-flags', 'compiler-features', 'type_traits',
+ opt.load(['default-compiler-flags', 'compiler-features',
'coverage', 'pch', 'sanitizers', 'osx-frameworks',
'boost', 'openssl', 'sqlite3',
'doxygen', 'sphinx_build'],
@@ -67,7 +67,7 @@
conf.fatal('Either static library or shared library must be enabled')
conf.load(['compiler_cxx', 'gnu_dirs', 'c_osx',
- 'default-compiler-flags', 'compiler-features', 'type_traits',
+ 'default-compiler-flags', 'compiler-features',
'pch', 'osx-frameworks', 'boost', 'openssl', 'sqlite3',
'doxygen', 'sphinx_build'])
@@ -89,15 +89,13 @@
'linux/netlink.h', 'linux/rtnetlink.h']):
conf.env['HAVE_RTNETLINK'] = True
conf.check_cxx(msg='Checking for IFA_FLAGS', define_name='HAVE_IFA_FLAGS', mandatory=False,
- fragment='''
- #include <linux/if_addr.h>
- int main() { return IFA_FLAGS; }
- ''')
+ fragment='''#include <linux/if_addr.h>
+ int main() { return IFA_FLAGS; }''')
conf.check_osx_frameworks()
conf.check_sqlite3(mandatory=True)
- conf.check_openssl(mandatory=True, atleast_version=0x10001000) # 1.0.1
+ conf.check_openssl(mandatory=True, atleast_version=0x1000200f) # 1.0.2
USED_BOOST_LIBS = ['system', 'filesystem', 'date_time', 'iostreams',
'regex', 'program_options', 'chrono', 'thread',
@@ -108,14 +106,11 @@
conf.define('HAVE_TESTS', 1)
conf.check_boost(lib=USED_BOOST_LIBS, mandatory=True, mt=True)
- if conf.env.BOOST_VERSION_NUMBER < 105400:
- conf.fatal('Minimum required Boost version is 1.54.0\n'
+ if conf.env.BOOST_VERSION_NUMBER < 105800:
+ conf.fatal('Minimum required Boost version is 1.58.0\n'
'Please upgrade your distribution or manually install a newer version of Boost'
' (https://redmine.named-data.net/projects/nfd/wiki/Boost_FAQ)')
- if conf.env['CXX_NAME'] == 'clang' and conf.env.BOOST_VERSION_NUMBER < 105800:
- conf.env.append_value('DEFINES', 'BOOST_ASIO_HAS_STD_ARRAY=1') # Bug #4096
-
if not conf.options.with_sqlite_locking:
conf.define('DISABLE_SQLITE3_FS_LOCKING', 1)