Combine pragmas

This commit is contained in:
Victor Zverovich 2020-09-22 14:47:35 -07:00
parent e5942ac9dd
commit 33712dc07a

View File

@ -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, "");