Skip to content

*: include fmt/ostream.h if FMT_VERSION >= 9 - #49052

Merged
tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-fmt-v9
Dec 2, 2022
Merged

tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-fmt-v9

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

before this change, we assume that fmt/ostream.h is included, and reference fmt::ostream_formatter. this breaks the build if the tree is compiled on {fmt} v9 and up.

after this change, fmt/ostream.h is conditionally included. as the compiling unit is supposed to include fmt headers before including headers in this project, we can tell if fmt/ostream.h is needed or not by checking the FMT_VERSION macro.

Signed-off-by: Kefu Chai [email protected]

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

before this change, we assume that `fmt/ostream.h` is included, and
reference `fmt::ostream_formatter`. this breaks the build if the tree
is compiled on {fmt} v9 and up.

after this change, `fmt/ostream.h` is conditionally included. as the
compiling unit is supposed to include fmt headers before including
headers in this project, we can tell if fmt/ostream.h is needed or not
by checking the FMT_VERSION macro.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov requested a review from ronen-fr November 25, 2022 09:08
@tchaikov
tchaikov requested a review from a team as a code owner November 25, 2022 09:08

@tserong tserong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (I ran a build on openSUSE Tubmleweed with fmt 9.1 and this patch applied, and the build completed successfully).

@tchaikov
tchaikov merged commit 279fcd0 into ceph:main Dec 2, 2022
@tchaikov
tchaikov deleted the wip-fmt-v9 branch December 2, 2022 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants