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()
This commit is contained in:
Sergei Golubchik 2016-02-17 13:48:13 +01:00
parent 77b548484e
commit dc92263ab3

View File

@ -813,6 +813,9 @@ inline unsigned long long my_double2ulonglong(double d)
#else #else
#define finite(x) (1.0 / fabs(x) > 0.0) #define finite(x) (1.0 / fabs(x) > 0.0)
#endif /* HAVE_FINITE */ #endif /* HAVE_FINITE */
#elif (__cplusplus >= 201103L)
#include <cmath>
static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */ #endif /* isfinite */
#ifndef HAVE_ISNAN #ifndef HAVE_ISNAN