src/*: drop backward compatibility with boost<1.72

boost 1.72 is required to build Ceph since
713efb66e8. so there is no need to be
backward compatible with older Boost libraries.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-11-24 14:36:30 +08:00
parent 3d70821909
commit 6c89be6885
4 changed files with 7 additions and 44 deletions

View File

@ -20,27 +20,18 @@
#include <boost/bind/bind.hpp>
#include <boost/function.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION >= 103800
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_confix.hpp>
#include <boost/spirit/include/classic_escape_char.hpp>
#include <boost/spirit/include/classic_multi_pass.hpp>
#include <boost/spirit/include/classic_position_iterator.hpp>
#define spirit_namespace boost::spirit::classic
#else
#include <boost/spirit/core.hpp>
#include <boost/spirit/utility/confix.hpp>
#include <boost/spirit/utility/escape_char.hpp>
#include <boost/spirit/iterator/multi_pass.hpp>
#include <boost/spirit/iterator/position_iterator.hpp>
#define spirit_namespace boost::spirit
#endif
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_confix.hpp>
#include <boost/spirit/include/classic_escape_char.hpp>
#include <boost/spirit/include/classic_multi_pass.hpp>
#include <boost/spirit/include/classic_position_iterator.hpp>
#include "include/ceph_assert.h"
namespace json_spirit
{
namespace spirit_namespace = boost::spirit::classic;
const spirit_namespace::int_parser < boost::int64_t > int64_p = spirit_namespace::int_parser < boost::int64_t >();
const spirit_namespace::uint_parser< boost::uint64_t > uint64_p = spirit_namespace::uint_parser< boost::uint64_t >();

View File

@ -82,12 +82,8 @@ class AsyncScheduler : public md_config_obs_t, public Scheduler {
using Completion = async::Completion<Signature, async::AsBase<Request>>;
using Clock = ceph::coarse_real_clock;
#if BOOST_VERSION < 107000
using Timer = boost::asio::basic_waitable_timer<Clock>;
#else
using Timer = boost::asio::basic_waitable_timer<Clock,
boost::asio::wait_traits<Clock>, executor_type>;
#endif
Timer timer; //< timer for the next scheduled request
CephContext *const cct;

View File

@ -253,13 +253,9 @@ class RGWReshardWait {
ceph::condition_variable cond;
struct Waiter : boost::intrusive::list_base_hook<> {
#if BOOST_VERSION < 107000
using Timer = boost::asio::basic_waitable_timer<Clock>;
#else
using Executor = boost::asio::io_context::executor_type;
using Timer = boost::asio::basic_waitable_timer<Clock,
boost::asio::wait_traits<Clock>, Executor>;
#endif
Timer timer;
explicit Waiter(boost::asio::io_context& ioc) : timer(ioc) {}
};

View File

@ -231,17 +231,6 @@ const char illegal_conf4[] = "\
keyring = osd_keyring ; osd's keyring\n\
";
#if BOOST_VERSION < 107200
// Boost::spirit > 1.72 asserts on chars that are not < 0x7f
// unicode config file
const char unicode_config_1[] = "\
[global]\n\
log file = \x66\xd1\x86\xd1\x9d\xd3\xad\xd3\xae \n\
pid file = foo-bar\n\
[osd0]\n\
";
#endif
const char override_config_1[] = "\
[global]\n\
log file = global_log\n\
@ -365,15 +354,6 @@ TEST(ConfUtils, ReadFiles2) {
ASSERT_EQ(val, "/quite/a/long/path/for/a/log/file");
ASSERT_EQ(cf1.read("global", "pid file", val), 0);
ASSERT_EQ(val, "spork");
#if BOOST_VERSION < 107200
std::string unicode_config_1f(next_tempfile(unicode_config_1));
ConfFile cf2;
ASSERT_EQ(cf2.parse_file(unicode_config_1f.c_str(), &err), 0);
ASSERT_EQ(err.tellp(), 0U);
ASSERT_EQ(cf2.read("global", "log file", val), 0);
ASSERT_EQ(val, "\x66\xd1\x86\xd1\x9d\xd3\xad\xd3\xae");
#endif
}
TEST(ConfUtils, IllegalFiles) {