mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-01 09:08:42 +00:00
Combine pragmas
This commit is contained in:
parent
e5942ac9dd
commit
33712dc07a
@ -202,8 +202,14 @@ FMT_BEGIN_NAMESPACE
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
|
// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning.
|
||||||
# ifndef __clang__
|
# ifndef __clang__
|
||||||
|
# pragma intrinsic(_BitScanForward)
|
||||||
# pragma intrinsic(_BitScanReverse)
|
# pragma intrinsic(_BitScanReverse)
|
||||||
# endif
|
# endif
|
||||||
|
# if defined(_WIN64) && !defined(__clang__)
|
||||||
|
# pragma intrinsic(_BitScanForward64)
|
||||||
|
# pragma intrinsic(_BitScanReverse64)
|
||||||
|
# endif
|
||||||
|
|
||||||
inline int clz(uint32_t x) {
|
inline int clz(uint32_t x) {
|
||||||
unsigned long r = 0;
|
unsigned long r = 0;
|
||||||
_BitScanReverse(&r, x);
|
_BitScanReverse(&r, x);
|
||||||
@ -216,10 +222,6 @@ inline int clz(uint32_t x) {
|
|||||||
}
|
}
|
||||||
# define FMT_BUILTIN_CLZ(n) detail::clz(n)
|
# define FMT_BUILTIN_CLZ(n) detail::clz(n)
|
||||||
|
|
||||||
# if defined(_WIN64) && !defined(__clang__)
|
|
||||||
# pragma intrinsic(_BitScanReverse64)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
inline int clzll(uint64_t x) {
|
inline int clzll(uint64_t x) {
|
||||||
unsigned long r = 0;
|
unsigned long r = 0;
|
||||||
# ifdef _WIN64
|
# ifdef _WIN64
|
||||||
@ -236,10 +238,6 @@ inline int clzll(uint64_t x) {
|
|||||||
}
|
}
|
||||||
# define FMT_BUILTIN_CLZLL(n) detail::clzll(n)
|
# 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) {
|
inline int ctz(uint32_t x) {
|
||||||
unsigned long r = 0;
|
unsigned long r = 0;
|
||||||
_BitScanForward(&r, x);
|
_BitScanForward(&r, x);
|
||||||
@ -249,10 +247,6 @@ inline int ctz(uint32_t x) {
|
|||||||
}
|
}
|
||||||
# define FMT_BUILTIN_CTZ(n) detail::ctz(n)
|
# define FMT_BUILTIN_CTZ(n) detail::ctz(n)
|
||||||
|
|
||||||
# if defined(_WIN64) && !defined(__clang__)
|
|
||||||
# pragma intrinsic(_BitScanForward64)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
inline int ctzll(uint64_t x) {
|
inline int ctzll(uint64_t x) {
|
||||||
unsigned long r = 0;
|
unsigned long r = 0;
|
||||||
FMT_ASSERT(x != 0, "");
|
FMT_ASSERT(x != 0, "");
|
||||||
|
Loading…
Reference in New Issue
Block a user