Skip to content

Commit dc92263

Browse files
committed
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()
1 parent 77b5484 commit dc92263

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/my_global.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,9 @@ inline unsigned long long my_double2ulonglong(double d)
813813
#else
814814
#define finite(x) (1.0 / fabs(x) > 0.0)
815815
#endif /* HAVE_FINITE */
816+
#elif (__cplusplus >= 201103L)
817+
#include <cmath>
818+
static inline bool isfinite(double x) { return std::isfinite(x); }
816819
#endif /* isfinite */
817820

818821
#ifndef HAVE_ISNAN

0 commit comments

Comments
 (0)