From 4b8e2838f0767793e060135f4824c4114e285678 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 27 Oct 2024 10:56:52 -0700 Subject: [PATCH] More cleanup --- include/fmt/format.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index fd57253c9645..ae39824c7ac0 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -174,6 +174,14 @@ FMT_END_NAMESPACE # define FMT_REDUCE_INT_INSTANTIATIONS 0 #endif +FMT_BEGIN_NAMESPACE + +template +struct is_contiguous> + : std::true_type {}; + +namespace detail { + // __builtin_clz is broken in clang with Microsoft codegen: // https://github.com/fmtlib/fmt/issues/519. #if !FMT_MSC_VERSION @@ -189,8 +197,6 @@ FMT_END_NAMESPACE // __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the // MSVC intrinsics if the clz and clzll builtins are not available. #if FMT_MSC_VERSION && !defined(FMT_BUILTIN_CLZLL) -FMT_BEGIN_NAMESPACE -namespace detail { // Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning. # ifndef __clang__ # pragma intrinsic(_BitScanReverse) @@ -224,18 +230,8 @@ inline auto clzll(uint64_t x) -> int { return 63 ^ static_cast(r); } # define FMT_BUILTIN_CLZLL(n) detail::clzll(n) -} // namespace detail -FMT_END_NAMESPACE #endif // FMT_MSC_VERSION && !defined(FMT_BUILTIN_CLZLL) -FMT_BEGIN_NAMESPACE - -template -struct is_contiguous> - : std::true_type {}; - -namespace detail { - FMT_CONSTEXPR inline void abort_fuzzing_if(bool condition) { ignore_unused(condition); #ifdef FMT_FUZZ @@ -1817,7 +1813,7 @@ auto find_escape(const Char* begin, const Char* end) inline auto find_escape(const char* begin, const char* end) -> find_escape_result { - if (!detail::use_utf8) return find_escape(begin, end); + if (!use_utf8) return find_escape(begin, end); auto result = find_escape_result{end, nullptr, 0}; for_each_codepoint(string_view(begin, to_unsigned(end - begin)), [&](uint32_t cp, string_view sv) {