diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-02-23 00:14:42 +0100 |
---|---|---|
committer | Bernd Schmidt <bernds@codesourcery.com> | 2011-03-05 19:48:10 +0100 |
commit | 2a19c1339d6bf46fe0f90fbd4e8dca6646d111ed (patch) | |
tree | a9e8cc3663e4904042c39b14eef15f30d652c923 /include | |
parent | 9b1507df250e90b74099e0d05170d7d95060b016 (diff) |
Implement ffsl and ffsll.
This imports and adapts ffsll.c from glibc. The same mechanism as in glibc
is used to choose between ffs and ffsll to implement ffsl. The single user
in libc is changed to use the hidden version __libc_ffs.
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Acked-by: Bernhard Reutner-Fischer <aldot@uclibc.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/string.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/string.h b/include/string.h index ca22055ed..66f64e7d1 100644 --- a/include/string.h +++ b/include/string.h @@ -374,11 +374,10 @@ extern char *rindex (__const char *__s, int __c) /* Return the position of the first bit set in I, or 0 if none are set. The least-significant bit is position 1, the most-significant 32. */ extern int ffs (int __i) __THROW __attribute__ ((__const__)); -libc_hidden_proto(ffs) /* The following two functions are non-standard but necessary for non-32 bit platforms. */ -# if 0 /*#ifdef __USE_GNU*/ +#ifdef __USE_GNU extern int ffsl (long int __l) __THROW __attribute__ ((__const__)); # ifdef __GNUC__ __extension__ extern int ffsll (long long int __ll) @@ -386,6 +385,13 @@ __extension__ extern int ffsll (long long int __ll) # endif # endif +#ifdef _LIBC +extern __typeof(ffs) __libc_ffs; +libc_hidden_proto(__libc_ffs); +extern __typeof(ffsll) __libc_ffsll; +libc_hidden_proto(__libc_ffsll) +#endif + /* Compare S1 and S2, ignoring case. */ extern int strcasecmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); |