Immediately executed lambda.
This commit is contained in:
parent
eafdd3eb81
commit
0230d69084
@ -18,14 +18,6 @@
|
|||||||
// The fmt library version in the form major * 10000 + minor * 100 + patch.
|
// The fmt library version in the form major * 10000 + minor * 100 + patch.
|
||||||
#define FMT_VERSION 80001
|
#define FMT_VERSION 80001
|
||||||
|
|
||||||
#if defined(__NVCOMPILER)
|
|
||||||
# define FMT_NVHPC_VERSION \
|
|
||||||
(__NVCOMPILER_MAJOR__ * 10000 + __NVCOMPILER_MINOR__ * 100 + \
|
|
||||||
__NVCOMPILER_PATCHLEVEL__)
|
|
||||||
#else
|
|
||||||
# define FMT_NVHPC_VERSION 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (__clang__ ) && !defined(__ibmxl__)
|
#if defined (__clang__ ) && !defined(__ibmxl__)
|
||||||
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
|
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
|
||||||
#else
|
#else
|
||||||
@ -39,12 +31,6 @@
|
|||||||
# define FMT_GCC_VERSION 0
|
# define FMT_GCC_VERSION 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_NVHPC_VERSION > 0
|
|
||||||
# define FMT_NVHPC_PRAGMA(arg) _Pragma(arg)
|
|
||||||
#else
|
|
||||||
# define FMT_NVHPC_PRAGMA(arg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef FMT_GCC_PRAGMA
|
#ifndef FMT_GCC_PRAGMA
|
||||||
// Workaround _Pragma bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.
|
// Workaround _Pragma bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884.
|
||||||
# if FMT_GCC_VERSION >= 504
|
# if FMT_GCC_VERSION >= 504
|
||||||
|
|||||||
@ -970,13 +970,14 @@ FMT_CONSTEXPR auto count_digits(UInt n) -> int {
|
|||||||
if (num_bits<UInt>() == 32)
|
if (num_bits<UInt>() == 32)
|
||||||
return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1;
|
return (FMT_BUILTIN_CLZ(static_cast<uint32_t>(n) | 1) ^ 31) / BITS + 1;
|
||||||
#endif
|
#endif
|
||||||
FMT_NVHPC_PRAGMA("diag_suppress initialization_not_reachable")
|
// Lambda avoids unreachable code warnings from NVHPC.
|
||||||
int num_digits = 0;
|
return [](UInt n) {
|
||||||
FMT_NVHPC_PRAGMA("diag_default initialization_not_reachable")
|
int num_digits = 0;
|
||||||
do {
|
do {
|
||||||
++num_digits;
|
++num_digits;
|
||||||
} while ((n >>= BITS) != 0);
|
} while ((n >>= BITS) != 0);
|
||||||
return num_digits;
|
return num_digits;
|
||||||
|
}(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;
|
template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user