Commit b42eb01e authored by unknown's avatar unknown

If isinf() is not available on a target platform, use our own imlementation...

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.


parent 024dbd23
...@@ -784,13 +784,20 @@ typedef SOCKET_SIZE_TYPE size_socket; ...@@ -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. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment