Add missing xchar.h header for fmt > 11.0.2 (v2)#3277
Closed
ahoarau wants to merge 1 commit intogabime:v1.xfrom
Closed
Add missing xchar.h header for fmt > 11.0.2 (v2)#3277ahoarau wants to merge 1 commit intogabime:v1.xfrom
ahoarau wants to merge 1 commit intogabime:v1.xfrom
Conversation
In fmt > 11.0.2, basic_format_string has moved from base.h to xchar.h
Owner
|
fmt/xchar.h is expensive to include if wchar is not required. Why can't you include it in your code? |
Contributor
|
#3301 fixes the problem without including |
yachoor
referenced
this pull request
Jan 8, 2025
Include fmtlib's `xchar` header to include `fmt::basic_format_string`.
Otherwise, compilation with an external fmtlib 11.1.1 fails with
```
In file included from include/spdlog/spdlog.h:12:
include/spdlog/common.h:369:49: error: no template named 'basic_format_string' in namespace 'fmt'; did you mean 'std::basic_format_string'?
369 | inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
| ^~~~~
```
Signed-off-by: Christian Blichmann <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Better version than #3274
Fixes #3202
NOTE: I cannot conditionally add the header based on the FMT version, as it's stuck to
#define FMT_VERSION 110002, even though we're passed that version.Tested fine on
Ubuntu+clang&gcc, on both release and debug.