[Mesa-dev] [PATCH 5/6] gallium/util: Add an implementation of ffsl
Marek Olšák
maraeo at gmail.com
Sat Aug 15 17:36:37 PDT 2015
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Sat, Aug 15, 2015 at 8:31 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
> src/gallium/auxiliary/util/u_math.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
> index 56bd185..5814421 100644
> --- a/src/gallium/auxiliary/util/u_math.h
> +++ b/src/gallium/auxiliary/util/u_math.h
> @@ -391,6 +391,18 @@ unsigned ffs( unsigned u )
>
> #endif /* FFS_DEFINED */
>
> +#ifndef FFSL_DEFINED
> +#define FFSL_DEFINED 1
> +
> +#ifdef _MSC_VER
> +/* With MSVC, int and long are the same type even on 64-bit */
> +#define ffsl ffs
> +#else
> +#define ffsl(x) ((sizeof(long) == sizeof(int)) ? ffs(x) : ffsll(x))
> +#endif
> +
> +#endif /* FFSL_DEFINED */
> +
> /**
> * Find first bit set in long long. Least significant bit is 1.
> * Return 0 if no bits set.
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list