diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-17 13:48:13 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-17 15:10:51 +0100 |
commit | dc92263ab3d2649d657bfd586b4500704d08cbe4 (patch) | |
tree | a2915f08698b46ae771d001709e5a880592bbe4f | |
parent | 77b548484eb1b7bc78757eb2e2d3cf5e83116d75 (diff) | |
download | mariadb-git-dc92263ab3d2649d657bfd586b4500704d08cbe4.tar.gz |
MDEV-9308 Fix build errors with recent gcc (isfinite)
"#include <math.h>" has "#define isfinite(X) ..."
while "#include <cmath>" does "#undef isfinite"
in -std=c++11 mode <cmath> is included, we need a workaround
to provide a usable isfinite()
-rw-r--r-- | include/my_global.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h index 5901dcdcea1..4c58c21b2aa 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -813,6 +813,9 @@ inline unsigned long long my_double2ulonglong(double d) #else #define finite(x) (1.0 / fabs(x) > 0.0) #endif /* HAVE_FINITE */ +#elif (__cplusplus >= 201103L) +#include <cmath> +static inline bool isfinite(double x) { return std::isfinite(x); } #endif /* isfinite */ #ifndef HAVE_ISNAN |