summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-08-05 12:54:05 +0900
committerChia-I Wu <[email protected]>2011-08-21 02:01:48 +0800
commit504f92c739ffc916084ed821cb9f437276213057 (patch)
treefbf457f2c5aaed8bb0b0e2cf63fa0b646d8c12ee /src
parentb34770d83465f969eae57436d5aa9f4d31278c10 (diff)
mesa: android has no log2f nor ffs
Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs. Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/imports.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 3fa1db02aee..70defdc4327 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -134,7 +134,13 @@ typedef union { GLfloat f; GLint i; } fi_type;
#define exp2f(f) ((float) exp2(f))
#define floorf(f) ((float) floor(f))
#define logf(f) ((float) log(f))
+
+#ifdef ANDROID
+#define log2f(f) (logf(f) * (float) (1.0 / M_LN2))
+#else
#define log2f(f) ((float) log2(f))
+#endif
+
#define powf(x,y) ((float) pow(x,y))
#define sinf(f) ((float) sin(f))
#define sinhf(f) ((float) sinh(f))
@@ -562,7 +568,7 @@ _mesa_init_sqrt_table(void);
#ifdef __GNUC__
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(ANDROID)
#define ffs __builtin_ffs
#define ffsll __builtin_ffsll
#endif