aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/p_util.h
diff options
context:
space:
mode:
authormichal <michal@michal-laptop.(none)>2007-08-16 19:44:53 +0100
committermichal <michal@michal-laptop.(none)>2007-08-16 19:44:53 +0100
commit546f1fa01920aeb777a03c4d2c72405d038dd96e (patch)
tree5425d5b5d5a9c6b0e33ac78943f77f7086fde5dd /src/mesa/pipe/p_util.h
parentbef9b40c3904fdffea6cc426c5c82ed3ab70a902 (diff)
Define ffs() for __WIN32__ & __MSC__.
Break mesa dependencies.
Diffstat (limited to 'src/mesa/pipe/p_util.h')
-rw-r--r--[-rwxr-xr-x]src/mesa/pipe/p_util.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h
index f4af16a2dea..69b69a3c67d 100755..100644
--- a/src/mesa/pipe/p_util.h
+++ b/src/mesa/pipe/p_util.h
@@ -38,6 +38,18 @@
#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.