]> git.saurik.com Git - redis.git/blame - deps/jemalloc/include/msvc_compat/strings.h
Jemalloc updated to 3.0.0.
[redis.git] / deps / jemalloc / include / msvc_compat / strings.h
CommitLineData
4934f93d 1#ifndef strings_h
2#define strings_h
3
4/* MSVC doesn't define ffs/ffsl. This dummy strings.h header is provided
5 * for both */
6#include <intrin.h>
7#pragma intrinsic(_BitScanForward)
8static __forceinline int ffsl(long x)
9{
10 unsigned long i;
11
12 if (_BitScanForward(&i, x))
13 return (i + 1);
14 return (0);
15}
16
17static __forceinline int ffs(int x)
18{
19
20 return (ffsl(x));
21}
22
23#endif