mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
If isinf() is not available on a target platform, use our own imlementation via finite() and isnan(). If either of the last two is not available as well, use simple replacements which are platform-neutral, but slower than compiler intrinsics.
This commit is contained in:
@@ -784,13 +784,20 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||||||
#define SSIZE_MAX ((~((size_t) 0)) / 2)
|
#define SSIZE_MAX ((~((size_t) 0)) / 2)
|
||||||
#endif
|
#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)
|
#if !defined(HAVE_ISINF)
|
||||||
/* The configure check for "isinf with math.h" has failed */
|
/* The configure check for "isinf with math.h" has failed */
|
||||||
#ifdef isinf
|
#ifdef isinf
|
||||||
#undef isinf
|
#undef isinf
|
||||||
#endif
|
#endif
|
||||||
/* Define isinf to never say that X is infinite */
|
#define isinf(X) (!finite(X) && !isnan(X))
|
||||||
#define isinf(X) 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define missing math constants. */
|
/* Define missing math constants. */
|
||||||
|
Reference in New Issue
Block a user