]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushTester: workaround a bug in boost::icl 7560/head
authorKefu Chai <kchai@redhat.com>
Mon, 8 Feb 2016 05:37:43 +0000 (13:37 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 8 Feb 2016 05:37:45 +0000 (13:37 +0800)
the boost::icl in boost v1.55 has a bug when working with libc++,

> Assertion failed: (this->_map.find(inter_val) == this->_map.end()),
> function gap_insert, file
> /usr/local/include/boost/icl/interval_base_map.hpp, line 555.

see https://svn.boost.org/trac/boost/ticket/9501 and
    https://svn.boost.org/trac/boost/ticket/9987

the bug was fixed in boost v1.56. as a workaround we use the the
`set` from `boost::container` instead of the `std::set` from libc++.
we should drop this workaround once we bump the supported boost
version from 1.42 to 1.56.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crush/CrushTester.cc

index da1ed9442632e67875ee33fec9da1a47762b1416..2ebe8c23d87ee3cf385e1eafa32a4f0a3654d0fc 100644 (file)
@@ -8,6 +8,13 @@
 #include <algorithm>
 #include <stdlib.h>
 #include <boost/lexical_cast.hpp>
+// to workaround https://svn.boost.org/trac/boost/ticket/9501
+#ifdef _LIBCPP_VERSION
+#include <boost/version.hpp>
+#if BOOST_VERSION < 105600
+#define ICL_USE_BOOST_MOVE_IMPLEMENTATION
+#endif
+#endif
 #include <boost/icl/interval_map.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include <common/SubProcess.h>