summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2008-11-12 17:14:07 +0100
committerMichal Krol <[email protected]>2008-11-12 18:20:19 +0100
commit50357ad35181b7b170abe8413d4ef772978aa5f5 (patch)
treed25e719fc7bd49adf4babc713b780c497b06a1c1 /src/gallium/auxiliary/util
parent1bfe7c36bac4b8e5ddfcce537603aa8a5f35529d (diff)
util: Add log2() definition for MSC.
Diffstat (limited to 'src/gallium/auxiliary/util')
-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 d2eaa2e7f75..62272110ce3 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