[Mesa-dev] [PATCH] mesa/main: fix incorrect use of _mesa_ffsll. _mesa_ffsll may or may not be defined on GNUC

Brian Paul brian.e.paul at gmail.com
Tue Jan 3 14:54:41 PST 2012


On Tue, Jan 3, 2012 at 1:49 PM, Alexander von Gluck
<kallisti5 at unixzen.com> wrote:
> ---
>  src/mesa/main/arrayobj.c |    2 +-
>  src/mesa/main/imports.h  |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
> index 4b3e07b..29bfed8 100644
> --- a/src/mesa/main/arrayobj.c
> +++ b/src/mesa/main/arrayobj.c
> @@ -303,7 +303,7 @@ _mesa_update_array_object_max_element(struct gl_context
> *ctx,
>    GLuint min = ~0u;
>
>    while (enabled) {
> -      GLint attrib = _mesa_ffsll(enabled) - 1;
> +      GLint attrib = ffsll(enabled) - 1;

Why are you changing this line?  On a non-gnu platform we may not have ffsll().


>       enabled &= ~BITFIELD64_BIT(attrib);
>       min = update_min(min, &arrayObj->VertexAttrib[attrib]);
>    }
> diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
> index b7e8743..3cba312 100644
> --- a/src/mesa/main/imports.h
> +++ b/src/mesa/main/imports.h
> @@ -568,7 +568,7 @@ _mesa_init_sqrt_table(void);
>
>  #ifdef __GNUC__
>
> -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(ANDROID) ||
> defined(__APPLE__)
> +#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(ANDROID) ||
> defined(__APPLE__) || defined(__HAIKU__)
>  #define ffs __builtin_ffs
>  #define ffsll __builtin_ffsll
>  #endif
> --
> 1.7.7.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

-Brian


More information about the mesa-dev mailing list