mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-27 20:55:28 +08:00
libkern.h: Add ffsll()
This commit is contained in:
parent
127296ce97
commit
9128d209e5
@ -160,9 +160,6 @@ int flsl(long);
|
|||||||
int flsll(long long);
|
int flsll(long long);
|
||||||
#endif
|
#endif
|
||||||
#else /* __rtems__ */
|
#else /* __rtems__ */
|
||||||
#define ffs(_x) __builtin_ffs((unsigned int)(_x))
|
|
||||||
#define ffsl(_x) __builtin_ffsl((unsigned long)(_x))
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
builtin_fls(int x)
|
builtin_fls(int x)
|
||||||
{
|
{
|
||||||
@ -184,6 +181,9 @@ builtin_flsll(long long x)
|
|||||||
return (x != 0 ? sizeof(x) * 8 - __builtin_clzll((unsigned long long)x) : 0);
|
return (x != 0 ? sizeof(x) * 8 - __builtin_clzll((unsigned long long)x) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define ffs(_x) __builtin_ffs((unsigned int)(_x))
|
||||||
|
#define ffsl(_x) __builtin_ffsl((unsigned long)(_x))
|
||||||
|
#define ffsll(_x) __builtin_ffsll((unsigned long long)(_x))
|
||||||
#define fls(_x) builtin_fls(_x)
|
#define fls(_x) builtin_fls(_x)
|
||||||
#define flsl(_x) builtin_flsl(_x)
|
#define flsl(_x) builtin_flsl(_x)
|
||||||
#define flsll(_x) builtin_flsll(_x)
|
#define flsll(_x) builtin_flsll(_x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user