[Mesa-dev] [PATCH] gallium/util: Define ffsll on OpenBSD.

Matt Turner mattst88 at gmail.com
Fri Feb 6 11:58:13 PST 2015


On Fri, Feb 6, 2015 at 3:38 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> OpenBSD has ffs in libc but does not have ffsll so use the compiler
> builtin.  PIPE_OS_BSD isn't suitable here as FreeBSD has ffsll in libc.
>
> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> ---
>  src/gallium/auxiliary/util/u_math.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
> index 5db5b66..ec282f3 100644
> --- a/src/gallium/auxiliary/util/u_math.h
> +++ b/src/gallium/auxiliary/util/u_math.h
> @@ -531,6 +531,8 @@ unsigned ffs( unsigned u )
>  #elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID)
>  #define ffs __builtin_ffs
>  #define ffsll __builtin_ffsll
> +#elif defined(__OpenBSD__)
> +#define ffsll __builtin_ffsll
>  #endif

Autoconf checks for presence of a bunch of builtins. Please use those
instead (in this case, HAVE___BUILTIN_FFSLL).


More information about the mesa-dev mailing list