mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-25 21:07:46 +08:00
libkern.h: Avoid conflict with <strings.h>
This commit is contained in:
parent
e3e88e1d86
commit
127296ce97
@ -164,18 +164,29 @@ int flsll(long long);
|
|||||||
#define ffsl(_x) __builtin_ffsl((unsigned long)(_x))
|
#define ffsl(_x) __builtin_ffsl((unsigned long)(_x))
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
fls(int x)
|
builtin_fls(int x)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (x != 0 ? sizeof(x) * 8 - __builtin_clz((unsigned int)x) : 0);
|
return (x != 0 ? sizeof(x) * 8 - __builtin_clz((unsigned int)x) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
flsl(long x)
|
builtin_flsl(long x)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (x != 0 ? sizeof(x) * 8 - __builtin_clzl((unsigned long)x) : 0);
|
return (x != 0 ? sizeof(x) * 8 - __builtin_clzl((unsigned long)x) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
builtin_flsll(long long x)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (x != 0 ? sizeof(x) * 8 - __builtin_clzll((unsigned long long)x) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define fls(_x) builtin_fls(_x)
|
||||||
|
#define flsl(_x) builtin_flsl(_x)
|
||||||
|
#define flsll(_x) builtin_flsll(_x)
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
#define bitcount64(x) __bitcount64((uint64_t)(x))
|
#define bitcount64(x) __bitcount64((uint64_t)(x))
|
||||||
#define bitcount32(x) __bitcount32((uint32_t)(x))
|
#define bitcount32(x) __bitcount32((uint32_t)(x))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user