diff options
author | yongsheng.zhu@intel.com <yongsheng.zhu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-21 04:35:18 +0000 |
---|---|---|
committer | yongsheng.zhu@intel.com <yongsheng.zhu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-21 04:35:18 +0000 |
commit | 33aaf596dc33ca4ead7715abb712858d9bd25260 (patch) | |
tree | 84b9dadc454ac6835102ff8ab478b679bbbb9fa4 /third_party/mesa | |
parent | 880c6cd8b8dc5564156deb9c94dbb0a43346cf87 (diff) | |
download | chromium_src-33aaf596dc33ca4ead7715abb712858d9bd25260.zip chromium_src-33aaf596dc33ca4ead7715abb712858d9bd25260.tar.gz chromium_src-33aaf596dc33ca4ead7715abb712858d9bd25260.tar.bz2 |
Fix the compile errors for mesa on Android
There are some compile errors for mesa when trying to build gpu_tests
on Android. They were fixed in the mesa upstream.
So this patch combines 3 commits from mesa upstream. They are:
1) Commit eb0ff1a1c0 by chad@chad-versace.us: remove the use of
fpu_control.h
2) Commit 504f92c739 by olvaffe@gmail.com: android has no log2f
nor ffs
3) Commit 497baf4e4a by ian.d.romanick@intel.com: Use C-style
system headers in C++ code to avoid issues with std:: namespace
BUG=138226
TEST=
Review URL: https://chromiumcodereview.appspot.com/10825442
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mesa')
-rw-r--r-- | third_party/mesa/MesaLib/src/glsl/glsl_parser_extras.h | 2 | ||||
-rw-r--r-- | third_party/mesa/MesaLib/src/glsl/ir.h | 4 | ||||
-rw-r--r-- | third_party/mesa/MesaLib/src/mesa/main/compiler.h | 3 | ||||
-rw-r--r-- | third_party/mesa/MesaLib/src/mesa/main/debug.c | 11 | ||||
-rw-r--r-- | third_party/mesa/MesaLib/src/mesa/main/imports.c | 3 | ||||
-rw-r--r-- | third_party/mesa/MesaLib/src/mesa/main/imports.h | 6 | ||||
-rw-r--r-- | third_party/mesa/README.chromium | 2 |
7 files changed, 13 insertions, 18 deletions
diff --git a/third_party/mesa/MesaLib/src/glsl/glsl_parser_extras.h b/third_party/mesa/MesaLib/src/glsl/glsl_parser_extras.h index ddc2138..44e789a 100644 --- a/third_party/mesa/MesaLib/src/glsl/glsl_parser_extras.h +++ b/third_party/mesa/MesaLib/src/glsl/glsl_parser_extras.h @@ -31,7 +31,7 @@ #ifdef __cplusplus -#include <cstdlib> +#include <stdlib.h> #include "glsl_symbol_table.h" enum _mesa_glsl_parser_targets { diff --git a/third_party/mesa/MesaLib/src/glsl/ir.h b/third_party/mesa/MesaLib/src/glsl/ir.h index 5aa7c6d..456c43f 100644 --- a/third_party/mesa/MesaLib/src/glsl/ir.h +++ b/third_party/mesa/MesaLib/src/glsl/ir.h @@ -26,8 +26,8 @@ #ifndef IR_H #define IR_H -#include <cstdio> -#include <cstdlib> +#include <stdio.h> +#include <stdlib.h> extern "C" { #include <talloc.h> diff --git a/third_party/mesa/MesaLib/src/mesa/main/compiler.h b/third_party/mesa/MesaLib/src/mesa/main/compiler.h index 668fd09..907796f 100644 --- a/third_party/mesa/MesaLib/src/mesa/main/compiler.h +++ b/third_party/mesa/MesaLib/src/mesa/main/compiler.h @@ -45,9 +45,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#if defined(__linux__) && defined(__i386__) -#include <fpu_control.h> -#endif #include <float.h> #include <stdarg.h> diff --git a/third_party/mesa/MesaLib/src/mesa/main/debug.c b/third_party/mesa/MesaLib/src/mesa/main/debug.c index 526145a..bcbd837 100644 --- a/third_party/mesa/MesaLib/src/mesa/main/debug.c +++ b/third_party/mesa/MesaLib/src/mesa/main/debug.c @@ -216,17 +216,6 @@ static void add_debug_flags( const char *debug ) if (strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; -#if defined(_FPU_GETCW) && defined(_FPU_SETCW) - if (strstr(debug, "fpexceptions")) { - /* raise FP exceptions */ - fpu_control_t mask; - _FPU_GETCW(mask); - mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM - | _FPU_MASK_OM | _FPU_MASK_UM); - _FPU_SETCW(mask); - } -#endif - #else (void) debug; #endif diff --git a/third_party/mesa/MesaLib/src/mesa/main/imports.c b/third_party/mesa/MesaLib/src/mesa/main/imports.c index 46e5c93..2cbb09d 100644 --- a/third_party/mesa/MesaLib/src/mesa/main/imports.c +++ b/third_party/mesa/MesaLib/src/mesa/main/imports.c @@ -756,7 +756,8 @@ _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/third_party/mesa/MesaLib/src/mesa/main/imports.h b/third_party/mesa/MesaLib/src/mesa/main/imports.h index 751f206..3136b1e 100644 --- a/third_party/mesa/MesaLib/src/mesa/main/imports.h +++ b/third_party/mesa/MesaLib/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)) + +#if defined(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)) diff --git a/third_party/mesa/README.chromium b/third_party/mesa/README.chromium index acc23c9..db954fd 100644 --- a/third_party/mesa/README.chromium +++ b/third_party/mesa/README.chromium @@ -111,3 +111,5 @@ Later modifications (see chromium.patch): - Suppressed the OOB read reported by AddressSanitizer in _mesa_add_parameter from prog_parameter.c http://code.google.com/p/chromium/issues/detail?id=142316 + +- Fix the compile errors on Android |