Commit dc92263a authored by Sergei Golubchik's avatar Sergei Golubchik

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()
parent 77b54848
...@@ -813,6 +813,9 @@ inline unsigned long long my_double2ulonglong(double d) ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment