From: Kefu Chai Date: Fri, 16 Dec 2022 11:14:53 +0000 (+0800) Subject: rgw: be compatible with fmtlib v8 X-Git-Tag: v18.1.0~631^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d012e47d86ed07b3d70ce69cc5eb4712aa28b64a;p=ceph.git 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 --- diff --git a/src/rgw/driver/rados/rgw_data_sync.h b/src/rgw/driver/rados/rgw_data_sync.h index 6f05d157c9a..7514d3f8a2c 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();