summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/my_global.h b/include/my_global.h
index f446c283d50..e9b371d8d30 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -784,13 +784,20 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define SSIZE_MAX ((~((size_t) 0)) / 2)
#endif
+#ifndef HAVE_FINITE
+#define finite(x) (1.0 / fabs(x) > 0.0)
+#endif
+
+#ifndef HAVE_ISNAN
+#define isnan(x) ((x) != (x))
+#endif
+
#if !defined(HAVE_ISINF)
/* The configure check for "isinf with math.h" has failed */
#ifdef isinf
#undef isinf
#endif
-/* Define isinf to never say that X is infinite */
-#define isinf(X) 0
+#define isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */