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

Alexander von Gluck kallisti5 at unixzen.com
Tue Jan 3 12:49:09 PST 2012


---
  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;
        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



More information about the mesa-dev mailing list