summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2018-05-25 22:16:04 +0400
committerVlad Lesin <vlad_lesin@mail.ru>2019-11-19 16:28:15 +0300
commit6718d3bc3241f72e07504133371cf3813d2e6fe9 (patch)
treed93a3b16f5559c8bde8649e6348fcc54f606101c /include
parentb80df9eba23b4eb9694e770a41135127c6dbc5df (diff)
downloadmariadb-git-6718d3bc3241f72e07504133371cf3813d2e6fe9.tar.gz
MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOS
The fix consists of three commits backported from 10.3: 1) Cleanup isnan() portability checks (cherry picked from commit 7ffd7fe9627d1f750a3712aebb4503e5ae8aea8e) 2) Cleanup isinf() portability checks Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2 build would cache undefined HAVE_ISINF from 10.2, whereas it is expected to be 1 in 10.3. std::isinf() seem to be available on all supported platforms. (cherry picked from commit bc469a0bdf85400f7a63834f5b7af1a513dcdec9) 3) Use std::isfinite in C++ code This is addition to parent revision fixing build failures. (cherry picked from commit 54999f4e75f42baca484ae436b382ca8817df1dd)
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 4ce4671c571..8103f82a7e2 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -811,26 +811,8 @@ inline unsigned long long my_double2ulonglong(double d)
#define SIZE_T_MAX (~((size_t) 0))
#endif
-#ifndef isfinite
-#ifdef HAVE_FINITE
-#define isfinite(x) finite(x)
-#else
-#define finite(x) (1.0 / fabs(x) > 0.0)
-#endif /* HAVE_FINITE */
-#elif (__cplusplus >= 201103L)
+#ifdef __cplusplus
#include <cmath>
-static inline bool isfinite(double x) { return std::isfinite(x); }
-#endif /* isfinite */
-
-#ifndef HAVE_ISNAN
-#define isnan(x) ((x) != (x))
-#endif
-#define my_isnan(x) isnan(x)
-
-#ifdef HAVE_ISINF
-#define my_isinf(X) isinf(X)
-#else /* !HAVE_ISINF */
-#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */