diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-04-25 00:38:58 -0400 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-04-25 10:38:06 -0400 |
commit | d03db3b9d0b36a2e45a035acc4102e9172702171 (patch) | |
tree | a550bde9a857d94ab0f6de1df91b5ab16853b8eb /src/util/math.h | |
parent | d2322140db433001de4d3876de5d76fb8b3249f9 (diff) |
Fix std=c++0x issue where 'using std::isnan;' collides with the new global-namespace version in c++11.
Diffstat (limited to 'src/util/math.h')
-rw-r--r-- | src/util/math.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/util/math.h b/src/util/math.h index b6894633fa..a5fe016ef0 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -40,9 +40,13 @@ inline bool even(const T& value) { #define isnan(x) _isnan(x) #define isinf(x) (!_finite(x)) #else -// for isnan() everywhere else use cmath.h's version -using std::isnan; -using std::isinf; +// for isnan() and isinf() everywhere else use the cmath version. We define +// these as macros to prevent clashing with c++11 built-ins in the global +// namespace. If you say "using std::isnan;" then this will fail to build with +// std=c++11. See https://bugs.webkit.org/show_bug.cgi?id=59249 for some +// relevant discussion. +#define isnan std::isnan +#define isinf std::isinf #endif inline int roundUpToPowerOf2(int v) { |