util: Add log2() definition for MSC.
authorMichal Krol <michal@tungstengraphics.com>
Wed, 12 Nov 2008 16:14:07 +0000 (17:14 +0100)
committerMichal Krol <michal@tungstengraphics.com>
Wed, 12 Nov 2008 17:20:19 +0000 (18:20 +0100)
src/gallium/auxiliary/util/u_math.h

index d2eaa2e7f75c4474ff9ba531e1fc75a9699eeab3..62272110ce3362d8462acddab94cbabe7b4baa3b 100644 (file)
@@ -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