bundy icon indicating copy to clipboard operation
bundy copied to clipboard

bundy does not build with boost 1.60

Open DonLewisFreeBSD opened this issue 8 years ago • 3 comments

When I attempt to build bundy with boost version 1.60, it fails with these errors because the BOOST_PFTO_WRAPPER() macro is no longer part of boost:

In file included from encode/base_n.cc:15: ../../../src/lib/util/encode/base32hex_from_binary.h:90:49: error: expected ')' base32hex_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/base32hex_from_binary.h:90:26: note: to match this '(' base32hex_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/base32hex_from_binary.h:92:57: error: use of undeclared identifier 'start' Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))), ^ ../../../src/lib/util/encode/base32hex_from_binary.h:90:56: error: only constructors take base initializers base32hex_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ In file included from encode/base_n.cc:16: ../../../src/lib/util/encode/binary_from_base32hex.h:99:50: error: expected ')' binary_from_base32hex(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/binary_from_base32hex.h:99:26: note: to match this '(' binary_from_base32hex(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/binary_from_base32hex.h:101:57: error: use of undeclared identifier 'start' Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))), ^ ../../../src/lib/util/encode/binary_from_base32hex.h:99:57: error: only constructors take base initializers binary_from_base32hex(BOOST_PFTO_WRAPPER(T) start) : ^ In file included from encode/base_n.cc:17: ../../../src/lib/util/encode/base16_from_binary.h:88:46: error: expected ')' base16_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/base16_from_binary.h:88:23: note: to match this '(' base16_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/base16_from_binary.h:90:57: error: use of undeclared identifier 'start' Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))), ^ ../../../src/lib/util/encode/base16_from_binary.h:88:53: error: only constructors take base initializers base16_from_binary(BOOST_PFTO_WRAPPER(T) start) : ^ In file included from encode/base_n.cc:18: ../../../src/lib/util/encode/binary_from_base16.h:96:47: error: expected ')' binary_from_base16(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/binary_from_base16.h:96:23: note: to match this '(' binary_from_base16(BOOST_PFTO_WRAPPER(T) start) : ^ ../../../src/lib/util/encode/binary_from_base16.h:98:57: error: use of undeclared identifier 'start' Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))), ^ ../../../src/lib/util/encode/binary_from_base16.h:96:54: error: only constructors take base initializers binary_from_base16(BOOST_PFTO_WRAPPER(T) start) : ^ encode/base_n.cc:307:19: error: no matching conversion for functional-style cast from 'bundy::util::encode::::EncodeNormalizer' to 'boost::archive::iterators::base32hex_from_binaryboost::archive::iterators::transform_width<bundy::util::encode::<anonymous::EncodeNormalizer, 5, 8, unsigned char>, unsigned char>' result.assign(Encoder(EncodeNormalizer(binary.begin(), binary.end())), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ encode/base_n.cc:458:35: note: in instantiation of member function 'bundy::util::encode::::BaseNTransformer<5, '0', boost::archive::iterators::base32hex_from_binary<boost::archive::iterators::transform_width<bundy::util::encode::::EncodeNormalizer, 5, 8, unsigned char>, unsigned char> , boost::archive::iterators::transform_widthboost::archive::iterators::binary_from_base32hex<bundy::util::encode::<anonymous::DecodeNormalizer, char>, 8, 5, char> >::encode' requested here return (Base32HexTransformer::encode(binary)); ^ ../../../src/lib/util/encode/base32hex_from_binary.h:97:5: note: candidate constructor not viable: no known conversion from 'bundy::util::encode::::EncodeNormalizer' to 'const boost::archive::iterators::base32hex_from_binaryboost::archive::iterators::transform_width<bundy::util::encode::<anonymous::Enco deNormalizer, 5, 8, unsigned char>, unsigned char>' for 1st argument base32hex_from_binary(const base32hex_from_binary & rhs) : ^ In file included from encode/base_n.cc:26: /usr/local/include/boost/archive/iterators/transform_width.hpp:112:17: error: no matching conversion for functional-style cast from 'bundy::util::encode::::DecodeNormalizer' to 'boost::archive::iterators::binary_from_base32hexbundy::util::encode::<anonymous::DecodeNormalizer, char>' super_t(Base(static_cast< T >(start))), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ encode/base_n.cc:376:23: note: in instantiation of function template specialization 'boost::archive::iterators::transform_widthboost::archive::iterators::binary_from_base32hex<bundy::util::encode::<anonymous::DecodeNormalizer, char>, 8, 5, char>::transform_widthbundy::util::encode::anonymous::DecodeNormalizer' requested here result.assign(Decoder(DecodeNormalizer(BaseZeroCode, input.begin(), [SNIP]

DonLewisFreeBSD avatar Mar 14 '16 20:03 DonLewisFreeBSD

Sorry for not looking at this earlier. I'm not sure what the BOOST_PFTO_WRAPPER macro does, so I'm not sure what to do about it. I'll continue to dig into this at some point, but if anyone knows what this is for it would be a big help. :smiley:

shane-kerr avatar Apr 06 '16 23:04 shane-kerr

Poking around in https://github.com/boostorg/serialization I find this:

commit 5a94e5e4eb01cd8c941db725e5f89965a91740a9
Author: Robert Ramey <[email protected]>
Date:   Mon Mar 23 15:29:57 2015 -0700

    removed pfto

And https://kea.isc.org/ticket/4006 suggests a workaround which works for me!

diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc
index 688792b..2c1463b 100644
--- a/src/lib/util/encode/base_n.cc
+++ b/src/lib/util/encode/base_n.cc
@@ -12,6 +12,10 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.

+// workaround for PFTO (Partial Function Template Ordering) being removed from Boost 1.59
+#define BOOST_PFTO_WRAPPER(T) T
+#define BOOST_MAKE_PFTO_WRAPPER(t) t
+
 #include <util/encode/base32hex_from_binary.h>
 #include <util/encode/binary_from_base32hex.h>
 #include <util/encode/base16_from_binary.h>


dotysan avatar Oct 12 '16 22:10 dotysan

Created PR #104.

dotysan avatar Oct 12 '16 23:10 dotysan