]> granicus.if.org Git - pdns/commitdiff
rec: fallback to std::set when boost::container::flat_set is not available (boost...
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Tue, 27 Mar 2018 11:42:52 +0000 (13:42 +0200)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Tue, 27 Mar 2018 11:42:52 +0000 (13:42 +0200)
pdns/pdns_recursor.cc
pdns/recursordist/configure.ac

index d148546e33a99f90f25390f86754e7b027709421..302d2863bf91ed4c895541165765f2045271ffc2 100644 (file)
@@ -26,8 +26,9 @@
 #include <netdb.h>
 #include <sys/stat.h>
 #include <unistd.h>
-
+#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP
 #include <boost/container/flat_set.hpp>
+#endif
 #include "ws-recursor.hh"
 #include <pthread.h>
 #include "recpacketcache.hh"
@@ -161,7 +162,11 @@ static bool g_gettagNeedsEDNSOptions{false};
 static time_t g_statisticsInterval;
 static bool g_useIncomingECS;
 std::atomic<uint32_t> g_maxCacheEntries, g_maxPacketCacheEntries;
+#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP
 static boost::container::flat_set<uint16_t> s_avoidUdpSourcePorts;
+#else
+static std::set<uint16_t> s_avoidUdpSourcePorts;
+#endif
 static uint16_t s_minUdpSourcePort;
 static uint16_t s_maxUdpSourcePort;
 
index cc489370c16b4f75464f985dcb81ea6655f9ed40..5fd62492714c9eb08d53cd200971b73fa663a421 100644 (file)
@@ -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