From: Francis Dupont Date: Sun, 6 Oct 2019 19:53:12 +0000 (+0200) Subject: [497-kea-uses-deprecated-header] Fixed boost/{integer,math}/common_factor.h X-Git-Tag: Kea-1.7.1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F497-kea-uses-deprecated-header;p=thirdparty%2Fkea.git [497-kea-uses-deprecated-header] Fixed boost/{integer,math}/common_factor.h --- diff --git a/m4macros/ax_boost_for_kea.m4 b/m4macros/ax_boost_for_kea.m4 index f5d307260a..7090eecebe 100644 --- a/m4macros/ax_boost_for_kea.m4 +++ b/m4macros/ax_boost_for_kea.m4 @@ -79,6 +79,8 @@ AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-in header.)) +AC_CHECK_HEADERS(boost/integer/common_factor.hpp) + # Verify that the path does not include standard headers by mistake. # There are two regex.h headers: one is a standard system header (usually # in /usr/include) and the second one is provided by boost. If you specify the diff --git a/src/lib/asiolink/Makefile.am b/src/lib/asiolink/Makefile.am index b625f6ffd8..d04aacf344 100644 --- a/src/lib/asiolink/Makefile.am +++ b/src/lib/asiolink/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = . testutils tests AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib AM_CPPFLAGS += $(BOOST_INCLUDES) -AM_CXXFLAGS = $(KEA_CXXFLAGS) +AM_CXXFLAGS = $(KEA_CXXFLAGS) -Wno-non-virtual-dtor CLEANFILES = *.gcno *.gcda diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc index 5a78e882cd..82e5482492 100644 --- a/src/lib/util/encode/base_n.cc +++ b/src/lib/util/encode/base_n.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -18,7 +18,11 @@ #include #include #include +#ifdef HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP +#include +#else #include +#endif #include #include @@ -68,7 +72,7 @@ class IncompleteBaseInput : public std::exception { // // Its dereference operator // retrieves BitsIn bits from the result of "*Base" (if necessary it -// internally calls ++Base) +// internally calls ++Base) // // A conceptual description of how the encoding and decoding work is as // follows: @@ -93,7 +97,7 @@ namespace { // Common constants used for all baseN encoding. const char BASE_PADDING_CHAR = '='; const uint8_t BINARY_ZERO_CODE = 0; - + // EncodeNormalizer is an input iterator intended to be used as a filter // between the binary stream and baseXX_from_binary translator (via // transform_width). An EncodeNormalizer object is configured with two @@ -267,7 +271,11 @@ struct BaseNTransformer { // without padding. It's the least common multiple of 8 and BitsPerChunk, // e.g. 24 for base64. static const int BITS_PER_GROUP = +#ifdef HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP + boost::integer::static_lcm::value; +#else boost::math::static_lcm::value; +#endif // MAX_PADDING_CHARS is the maximum number of padding characters // that can appear in a valid baseN encoded text. @@ -281,7 +289,7 @@ struct BaseNTransformer { static const int MAX_PADDING_CHARS = BITS_PER_GROUP / BitsPerChunk - (8 / BitsPerChunk + ((8 % BitsPerChunk) == 0 ? 0 : 1)); -}; +}; template @@ -341,7 +349,7 @@ BaseNTransformer::decode( // 0000...0 0......0 000... // 0 7 8 15 16.... (bits) // The number of bits for the '==...' part is padchars * BitsPerChunk. - // So the total number of padding bits is the smallest multiple of 8 + // So the total number of padding bits is the smallest multiple of 8 // that is >= padchars * BitsPerChunk. // (Below, note the common idiom of the bitwise AND with ~7. It clears the // lowest three bits, so has the effect of rounding the result down to the