change location of ffs() code for windows
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 Sep 2005 02:44:40 +0000 (02:44 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 Sep 2005 02:44:40 +0000 (02:44 +0000)
src/mesa/main/imports.c

index f7d9de3..3bf9b95 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.3
+ * Version:  6.5
  *
  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
  *
@@ -528,27 +528,20 @@ _mesa_pow(double x, double y)
 }
 
 
-/* Windows does not have the ffs() function */
-#if defined(_WIN32) && !defined(__MINGW32__)
-int INLINE ffs(int value)
-{
-    int bit;
-    if (value == 0)
-       return 0;
-    for (bit=1; !(value & 1); bit++)
-       value >>= 1;
-    return bit;
-}
-#endif
-
-
 /**
- * Wrapper around either ffs() or xf86ffs().
+ * Find the first bit set in a word.
  */
 int
 _mesa_ffs(int i)
 {
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(_WIN32) && !defined(__MINGW32__)
+   int bit;
+   if (i == 0)
+      return 0;
+   for (bit = 1; !(i & 1); bit++)
+      i >>= 1;
+   return bit;
+#elif defined(XFree86LOADER) && defined(IN_MODULE)
    return xf86ffs(i);
 #else
    return ffs(i);