summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-17 13:48:13 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-17 15:10:51 +0100
commitdc92263ab3d2649d657bfd586b4500704d08cbe4 (patch)
treea2915f08698b46ae771d001709e5a880592bbe4f /include
parent77b548484eb1b7bc78757eb2e2d3cf5e83116d75 (diff)
downloadmariadb-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()
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h3
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