From d012e47d86ed07b3d70ce69cc5eb4712aa28b64a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 16 Dec 2022 19:14:53 +0800 Subject: [PATCH] rgw: be compatible with fmtlib v8 before fmtlib v9, fmtlib provides: template::value, char_t>> void fmt::print(std::basic_ostream &os, const S &format_str, Args&&... args) but in fmtlib v9 and up, it provides: template void fmt::print(std::ostream &os, format_string fmt, T&&... args) so we need to use different function signatures for talking to different fmtlib versions. please see https://fmt.dev/8.1.0/api.html#_CPPv4I0Dp0EN3fmt5printEvRNSt13basic_ostreamI4CharEERK1SDpRR4Args, and https://fmt.dev/9.0.0/api#_CPPv4IDpEN3fmt5printEvRNSt7ostreamE13format_stringIDp1TEDpRR1T fore more details. Signed-off-by: Kefu Chai --- src/rgw/driver/rados/rgw_data_sync.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/driver/rados/rgw_data_sync.h b/src/rgw/driver/rados/rgw_data_sync.h index 6f05d157c9a4c..7514d3f8a2c44 100644 --- a/src/rgw/driver/rados/rgw_data_sync.h +++ b/src/rgw/driver/rados/rgw_data_sync.h @@ -337,8 +337,13 @@ struct RGWDataSyncEnv { }; // pretty ostream output for `radosgw-admin bucket sync run` +#if FMT_VERSION >= 90000 template void pretty_print(const RGWDataSyncEnv* env, fmt::format_string fmt, T&& ...t) { +#else +template +void pretty_print(const RGWDataSyncEnv* env, const S& fmt, T&& ...t) { +#endif if (unlikely(!!env->ostr)) { fmt::print(*env->ostr, fmt, std::forward(t)...); env->ostr->flush(); -- 2.39.5