aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_math.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_math.h')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_math.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h
index 0b5284428..46d932293 100644
--- a/mesalib/src/gallium/auxiliary/util/u_math.h
+++ b/mesalib/src/gallium/auxiliary/util/u_math.h
@@ -199,6 +199,16 @@ roundf(float x)
#endif /* _MSC_VER */
+#ifdef PIPE_OS_ANDROID
+
+static INLINE
+double log2(double d)
+{
+ return log(d) * (1.0 / M_LN2);
+}
+
+#endif
+
@@ -409,7 +419,7 @@ unsigned ffs( unsigned u )
return i;
}
-#elif defined(__MINGW32__)
+#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID)
#define ffs __builtin_ffs
#endif