Add fls() for non-constant values.

This commit is contained in:
Michael Brown
2007-09-16 17:36:40 +01:00
parent b21d4ca21e
commit 6d15a193aa
2 changed files with 11 additions and 5 deletions

View File

@@ -40,17 +40,13 @@ __constant_flsl ( unsigned long x ) {
return r;
}
#define __constant_fls(x) __constant_flsl(x)
/* We don't actually have these functions yet */
extern int __fls ( int x );
extern int __flsl ( long x );
#define flsl( x ) \
( __builtin_constant_p ( x ) ? __constant_flsl ( x ) : __flsl ( x ) )
#define fls( x ) \
( __builtin_constant_p ( x ) ? __constant_fls ( x ) : __fls ( x ) )
#define fls( x ) flsl ( x )
extern int strcasecmp ( const char *s1, const char *s2 );