diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-21 18:10:25 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-21 18:10:25 +0000 |
commit | e510ef026f853574a76ff832d27b8292c03c707b (patch) | |
tree | 241f9266ee53bd28fb7959f97b62bd28383625ea | |
parent | ff34f1e559362fbff2c693ed16effb3046dba8e9 (diff) | |
download | src-e510ef026f853574a76ff832d27b8292c03c707b.tar.gz |
mesa compile fixes for Clang / VS2013
These functions are all defined in the standard library now,
and Clang warns about non-static declaration followed by static declaration.
R=scottmg@chromium.org
BUG=82385
Review URL: https://codereview.chromium.org/174153004/
git-svn-id: svn://svn.chromium.org/chrome/trunk/deps/third_party/mesa@252594 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 4 | ||||
-rw-r--r-- | src/mesa/main/imports.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 90b421e..05bb9e2 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -112,10 +112,13 @@ static INLINE float logf( float f ) #define logf(x) ((float)log((double)(x))) #endif /* logf */ +#if _MSC_VER < 1800 #define isfinite(x) _finite((double)(x)) #define isnan(x) _isnan((double)(x)) +#endif /* _MSC_VER < 1800 */ #endif /* _MSC_VER < 1400 && !defined(__cplusplus) */ +#if _MSC_VER < 1800 static INLINE double log2( double x ) { const double invln2 = 1.442695041; @@ -133,6 +136,7 @@ roundf(float x) { return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f); } +#endif #endif /* _MSC_VER */ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 4b74f70..827db2e 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -145,6 +145,7 @@ typedef union { GLfloat f; GLint i; GLuint u; } fi_type; #endif #if defined(_MSC_VER) +#if _MSC_VER < 1800 /* Not required on VS2013 and above. */ static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); } static inline float exp2f(float x) { return powf(2.0f, x); } static inline float log2f(float x) { return logf(x) * 1.442695041f; } @@ -153,6 +154,7 @@ static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); } static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; } static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } #define strtoll(p, e, b) _strtoi64(p, e, b) +#endif /* _MSC_VER < 1800 */ #endif /*@}*/ |