Provide ffs() and ffsl() via builtins

This commit is contained in:
Sebastian Huber 2015-10-30 14:14:46 +01:00
parent 293fefa43e
commit 524990c2ab

View File

@ -88,12 +88,17 @@ void arc4rand(void *ptr, u_int len, int reseed);
int bcmp(const void *, const void *, size_t);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
#ifndef __rtems__
#ifndef HAVE_INLINE_FFS
int ffs(int);
#endif
#ifndef HAVE_INLINE_FFSL
int ffsl(long);
#endif
#else /* __rtems__ */
#define ffs(_x) __builtin_ffs((unsigned int)(_x))
#define ffsl(_x) __builtin_ffsl((unsigned long)(_x))
#endif /* __rtems__ */
#ifndef HAVE_INLINE_FLS
int fls(int);
#endif