summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorChristian Schmidt <cs@blackwoodseven.com>2017-02-02 18:52:27 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-02-05 18:09:04 +0100
commit9ea0949f43959ff0cf519e7a10ef9de7a538cde3 (patch)
tree490e9a9d7d9eeb17528ac093c7948680c1623bbd /configure.in
parent21d7878690c18124fa788f2aa22e505a4fa6ceeb (diff)
downloadphp-git-9ea0949f43959ff0cf519e7a10ef9de7a538cde3.tar.gz
Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions. Also fix is_infinite(-INF) in case isinf is not defined.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/configure.in b/configure.in
index b5a3919e5f..d2f7567051 100644
--- a/configure.in
+++ b/configure.in
@@ -69,13 +69,13 @@ int zend_sprintf(char *buffer, const char *format, ...);
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
- #define HAVE_ISNAN 1
- #define HAVE_ISINF 1
- #define HAVE_ISFINITE 1
+ #define HAVE_DECL_ISNAN 1
+ #define HAVE_DECL_ISINF 1
+ #define HAVE_DECL_ISINFINITE 1
#endif
#ifndef zend_isnan
-#ifdef HAVE_ISNAN
+#ifdef HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -84,18 +84,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
-#ifdef HAVE_ISINF
+#ifdef HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
-#define zend_isinf(a) (((a)==INFINITY)?1:0)
+#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
-#if defined(HAVE_ISFINITE) || defined(isfinite)
+#if defined(HAVE_DECL_ISINFINITE) || defined(isfinite)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)