Skip to content

Commit

Permalink
MDEV-9308 Fix build errors with recent gcc (isfinite)
Browse files Browse the repository at this point in the history
"#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()
  • Loading branch information
vuvova committed Feb 17, 2016
1 parent 77b5484 commit dc92263
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/my_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc92263

Please sign in to comment.