]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/net/ProtocolV2: include fmt/chrono.h if fmt version >= 6.0
authorKefu Chai <kchai@redhat.com>
Tue, 27 Aug 2019 16:50:06 +0000 (00:50 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Aug 2019 06:46:43 +0000 (14:46 +0800)
commit9d0ff5b3b9d032c0625487ecbd266caf78cac831
treeb1a13baa0f4ca5dd55947e8200d469eea37085fe
parent101cc1fb512427168ef886a1dddcdbe1026e2cfd
crimson/net/ProtocolV2: include fmt/chrono.h if fmt version >= 6.0

* check libfmt version instead of the exisistence of chrono.h, as
  libfmt merged fmt/time.h into fmt/chrono.h since v 6.0, while in
  libfmt v5.3, fmt/chrono.h did not provide all the necessary bits
  for fmt::to_format(..., const tm&). see also
  https://github.com/fmtlib/fmt/commit/a939c75956d27996680ce498529da0d1668c4eac
  and https://github.com/fmtlib/fmt/blob/master/ChangeLog.rst
* use fmt API instead of libc API for getting `localtime()`, it's
  more C++ friendly than plain `localtime_r()`

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/net/ProtocolV2.cc