mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-08 07:42:09 +03:00
implement ffsl and ffsll functions
per the resolution of Austin Group issue #617, these are accepted for XSI option in POSIX future and thus I'm treating them as standard functions.
This commit is contained in:
parent
38db09374a
commit
ecc082c61b
@ -22,6 +22,8 @@ char *rindex (const char *, int);
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
int ffs (int);
|
||||
int ffsl (long);
|
||||
int ffsll (long long);
|
||||
#endif
|
||||
|
||||
int strcasecmp (const char *, const char *);
|
||||
|
7
src/misc/ffsl.c
Normal file
7
src/misc/ffsl.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <strings.h>
|
||||
#include "atomic.h"
|
||||
|
||||
int ffsl(long i)
|
||||
{
|
||||
return i ? a_ctz_l(i)+1 : 0;
|
||||
}
|
7
src/misc/ffsll.c
Normal file
7
src/misc/ffsll.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <strings.h>
|
||||
#include "atomic.h"
|
||||
|
||||
int ffsll(long long i)
|
||||
{
|
||||
return i ? a_ctz_64(i)+1 : 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user