Otherwise we'll get errors such as
error: conflicting types for ‘ffs’
error: conflicting types for ‘ffsll’
We might want to improve the heuristics and provide a definition only
when a native one is missing. We can address that at a later stage.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
#elif defined(_MSC_VER) && (_M_IX86 || _M_ARM || _M_AMD64 || _M_IA64)
#else
int
-ffs(unsigned i)
+ffs(int i)
{
int bit = 0;
if (!i)
#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64)
#else
int
-ffsll(uint64_t val)
+ffsll(long long int val)
{
int bit;
#define ffs __builtin_ffs
#elif defined(_MSC_VER) && (_M_IX86 || _M_ARM || _M_AMD64 || _M_IA64)
static inline
-int ffs(unsigned i)
+int ffs(int i)
{
unsigned long index;
if (_BitScanForward(&index, i))
}
#else
extern
-int ffs(unsigned i);
+int ffs(int i);
#endif
#ifdef HAVE___BUILTIN_FFSLL
#define ffsll __builtin_ffsll
#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64)
static inline int
-ffsll(uint64_t i)
+ffsll(long long int i)
{
unsigned long index;
if (_BitScanForward64(&index, i))
}
#else
extern int
-ffsll(uint64_t val);
+ffsll(long long int val);
#endif