]>
git.proxmox.com Git - rustc.git/blob - src/jemalloc/include/msvc_compat/strings.h
4 /* MSVC doesn't define ffs/ffsl. This dummy strings.h header is provided
8 # pragma intrinsic(_BitScanForward)
9 static __forceinline
int ffsl(long x
)
13 if (_BitScanForward(&i
, x
))
18 static __forceinline
int ffs(int x
)
25 # pragma intrinsic(_BitScanForward64)
28 static __forceinline
int ffsll(unsigned __int64 x
)
32 if (_BitScanForward64(&i
, x
))
36 // Fallback for 32-bit build where 64-bit version not available
37 // assuming little endian
45 if (_BitScanForward(&i
, s
.l
[0]))
47 else if(_BitScanForward(&i
, s
.l
[1]))
54 # define ffsll(x) __builtin_ffsll(x)
55 # define ffsl(x) __builtin_ffsl(x)
56 # define ffs(x) __builtin_ffs(x)
59 #endif /* strings_h */