Define ffs() for __WIN32__ & __MSC__.
authormichal <michal@michal-laptop.(none)>
Thu, 16 Aug 2007 18:44:53 +0000 (19:44 +0100)
committermichal <michal@michal-laptop.(none)>
Thu, 16 Aug 2007 18:44:53 +0000 (19:44 +0100)
Break mesa dependencies.

src/mesa/pipe/p_util.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index f4af16a..69b69a3
 
 #define Elements(x) sizeof(x)/sizeof(*(x))
 
+#if defined(__MSC__) && defined(__WIN32__)
+static INLINE unsigned ffs( unsigned u )
+{
+   unsigned i;
+
+   __asm bsf eax, [u]
+   __asm mov [i], eax
+
+   return i;
+}
+#endif
+
 union fi {
    float f;
    int i;
@@ -165,7 +177,7 @@ static INLINE int iround(float f)
 #if defined(__GNUC__)
 #define FABSF(x)   fabsf(x)
 #else
-#define FABSF(x)   ((GLfloat) fabs(x))
+#define FABSF(x)   ((float) fabs(x))
 #endif
 
 /* Pretty fast, and accurate.