]> granicus.if.org Git - pdns/commitdiff
Rec: support boost's fcontext in boost 1.61+
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 31 Aug 2016 14:22:57 +0000 (16:22 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 1 Sep 2016 10:35:45 +0000 (12:35 +0200)
pdns/mtasker_fcontext.cc
pdns/recursordist/configure.ac

index 1b2a11be266fbcea339e239c3486512b8edc02b0..bc37e769f1f007d4c8621b2a7162ee99ff4ba8c5 100644 (file)
 #include <exception>
 #include <cassert>
 #include <type_traits>
+#if BOOST_VERSION > 106100
+#include <boost/context/detail/fcontext.hpp>
+#else
 #include <boost/context/fcontext.hpp>
+#endif
 #include <boost/version.hpp>
 
 using boost::context::make_fcontext;
index 19ad1133c812b8b8c8ace8aa1855f04c2802042b..1d1500f0f301dc7082c4499db6646e9f0fd750aa 100644 (file)
@@ -54,9 +54,15 @@ AC_DEFUN([PDNS_SELECT_CONTEXT_IMPL], [
       LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
     fi
     AC_MSG_NOTICE([checking whether the Boost context library actually links...])
-    BOOST_FIND_HEADER([boost/context/fcontext.hpp], [ : ], [
-      BOOST_FIND_LIB([context], [$1], [boost/context/fcontext.hpp], [[]])
-    ])
+    if test $boost_major_version -ge 161; then
+      BOOST_FIND_HEADER([boost/context/detail/fcontext.hpp], [ : ], [
+        BOOST_FIND_LIB([context], [$1], [boost/context/detail/fcontext.hpp], [[]])
+      ])
+    else
+      BOOST_FIND_HEADER([boost/context/fcontext.hpp], [ : ], [
+        BOOST_FIND_LIB([context], [$1], [boost/context/fcontext.hpp], [[]])
+      ])
+    fi
     case $boost_cv_lib_context in
       (yes)
         AC_MSG_NOTICE([MTasker will use the Boost context library for context switching])