diff options
Diffstat (limited to 'src/mesa')
| -rw-r--r-- | src/mesa/main/imports.c | 2 | ||||
| -rw-r--r-- | src/mesa/main/imports.h | 7 | ||||
| -rw-r--r-- | src/mesa/main/querymatrix.c | 3 | 
3 files changed, 10 insertions, 2 deletions
| diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index cefbf4d8c9..d662e055b2 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -757,7 +757,7 @@ _mesa_strdup( const char *s )  float  _mesa_strtof( const char *s, char **end )  { -#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) +#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(ANDROID)     static locale_t loc = NULL;     if (!loc) {        loc = newlocale(LC_CTYPE_MASK, "C", NULL); diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 5ea647ad8d..c0686efed2 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -116,6 +116,7 @@ typedef union { GLfloat f; GLint i; } fi_type;  #endif +  /**   * \name Work-arounds for platforms that lack C99 math functions   */ @@ -134,7 +135,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) ((float) (log(f) / 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)) diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c index 944ad435f7..11c7b0669d 100644 --- a/src/mesa/main/querymatrix.c +++ b/src/mesa/main/querymatrix.c @@ -73,7 +73,8 @@ fpclassify(double x)  #elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \       defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \       (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \ -     (defined(__sun) && defined(__GNUC__)) +     (defined(__sun) && defined(__GNUC__)) || \ +     defined(ANDROID)  /* fpclassify is available. */ | 
