mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 11:33:46 +00:00
Cleanup
This commit is contained in:
parent
27e0bf72c0
commit
2418a84f02
12
format.h
12
format.h
@ -50,6 +50,12 @@
|
||||
namespace fmt {
|
||||
namespace internal {
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
inline uint32_t builtin_clz(uint32_t x) {
|
||||
unsigned long r = 0;
|
||||
_BitScanReverse(&r, x);
|
||||
return 31 - r;
|
||||
}
|
||||
# define FMT_BUILTIN_CLZ(n) fmt::internal::builtin_clz(n)
|
||||
# ifdef _WIN64
|
||||
# pragma intrinsic(_BitScanReverse64)
|
||||
inline uint32_t builtin_clzll(uint64_t n) {
|
||||
@ -59,12 +65,6 @@ inline uint32_t builtin_clzll(uint64_t n) {
|
||||
}
|
||||
# define FMT_BUILTIN_CLZLL(n) fmt::internal::builtin_clzll(n)
|
||||
# endif
|
||||
inline uint32_t builtin_clz(uint32_t x) {
|
||||
unsigned long r = 0;
|
||||
_BitScanReverse(&r, x);
|
||||
return 31 - r;
|
||||
}
|
||||
# define FMT_BUILTIN_CLZ(n) fmt::internal::builtin_clz(n)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user