From: Charles-Henri Bruyand Date: Tue, 27 Mar 2018 11:42:52 +0000 (+0200) Subject: rec: fallback to std::set when boost::container::flat_set is not available (boost... X-Git-Tag: dnsdist-1.3.0~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f097141b65b2ac27b3ce4b539c3c5ce2f67ea85c;p=pdns rec: fallback to std::set when boost::container::flat_set is not available (boost version < 1.48) --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d148546e3..302d2863b 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -26,8 +26,9 @@ #include #include #include - +#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP #include +#endif #include "ws-recursor.hh" #include #include "recpacketcache.hh" @@ -161,7 +162,11 @@ static bool g_gettagNeedsEDNSOptions{false}; static time_t g_statisticsInterval; static bool g_useIncomingECS; std::atomic g_maxCacheEntries, g_maxPacketCacheEntries; +#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP static boost::container::flat_set s_avoidUdpSourcePorts; +#else +static std::set s_avoidUdpSourcePorts; +#endif static uint16_t s_minUdpSourcePort; static uint16_t s_maxUdpSourcePort; diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index cc489370c..5fd624927 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -90,6 +90,10 @@ AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"], ) BOOST_REQUIRE([$boost_required_version]) + +# Check against flat_set header that requires boost >= 1.48 +BOOST_FIND_HEADER([boost/container/flat_set.hpp]) + PDNS_SELECT_CONTEXT_IMPL PDNS_ENABLE_UNIT_TESTS