From 33712dc07ade644c6d0d8e0ae2795700b9c17e7e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 22 Sep 2020 14:47:35 -0700 Subject: [PATCH] Combine pragmas --- include/fmt/format.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index b6078d3e..dfeb4539 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -202,8 +202,14 @@ FMT_BEGIN_NAMESPACE namespace detail { // Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning. # ifndef __clang__ +# pragma intrinsic(_BitScanForward) # pragma intrinsic(_BitScanReverse) # endif +# if defined(_WIN64) && !defined(__clang__) +# pragma intrinsic(_BitScanForward64) +# pragma intrinsic(_BitScanReverse64) +# endif + inline int clz(uint32_t x) { unsigned long r = 0; _BitScanReverse(&r, x); @@ -216,10 +222,6 @@ inline int clz(uint32_t x) { } # define FMT_BUILTIN_CLZ(n) detail::clz(n) -# if defined(_WIN64) && !defined(__clang__) -# pragma intrinsic(_BitScanReverse64) -# endif - inline int clzll(uint64_t x) { unsigned long r = 0; # ifdef _WIN64 @@ -236,10 +238,6 @@ inline int clzll(uint64_t x) { } # define FMT_BUILTIN_CLZLL(n) detail::clzll(n) -// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning. -# ifndef __clang__ -# pragma intrinsic(_BitScanForward) -# endif inline int ctz(uint32_t x) { unsigned long r = 0; _BitScanForward(&r, x); @@ -249,10 +247,6 @@ inline int ctz(uint32_t x) { } # define FMT_BUILTIN_CTZ(n) detail::ctz(n) -# if defined(_WIN64) && !defined(__clang__) -# pragma intrinsic(_BitScanForward64) -# endif - inline int ctzll(uint64_t x) { unsigned long r = 0; FMT_ASSERT(x != 0, "");