-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude fallback functions when FMT_BUILTIN_CLZ(LL) is not defined #2434
Conversation
Signed-off-by: Bodo Martin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. LGTM but please address inline comments.
include/fmt/format.h
Outdated
@@ -918,6 +918,7 @@ FMT_CONSTEXPR inline auto count_digits(uint128_t n) -> int { | |||
|
|||
// It is a separate function rather than a part of count_digits to workaround | |||
// the lack of static constexpr in constexpr functions. | |||
#ifdef FMT_BUILTIN_CLZLL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the #ifdef
right before the comment:
#ifdef FMT_BUILTIN_CLZLL
// It is a separate function rather than a part of count_digits to workaround
// the lack of static constexpr in constexpr functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
include/fmt/format.h
Outdated
@@ -964,6 +966,7 @@ template <> auto count_digits<4>(detail::fallback_uintptr n) -> int; | |||
|
|||
// It is a separate function rather than a part of count_digits to workaround | |||
// the lack of static constexpr in constexpr functions. | |||
#ifdef FMT_BUILTIN_CLZ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Thank you! |
Trivial change to format.h to exclude fallback functions when FMT_BUILTIN_CLZ and FMT_BUILTIN_CLZLL
are not available. Happens to me on windows clangcl msvc codegen