summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krol <michal@tungstengraphics.com>2008-11-12 17:14:07 +0100
committerMichal Krol <michal@tungstengraphics.com>2008-11-12 17:14:07 +0100
commitf447eea4de9cab5de295c717d35824cf92b9f322 (patch)
treeea08e459d2ee7e544de9a1495c5e3e2f98285297
parenta983f2a6ac04edc2b3407b44c2a1b5bc970c4ce3 (diff)
util: Add log2() definition for MSC.
-rw-r--r--src/gallium/auxiliary/util/u_math.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index be7303e550..c7bbebc428 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -161,6 +161,11 @@ static INLINE float logf( float f )
return (float) log( (double) f );
}
+static INLINE double log2( double x )
+{
+ return log( x ) / log( 2.0 );
+}
+
#else
/* Work-around an extra semi-colon in VS 2005 logf definition */
#ifdef logf