summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorJon Parise <jon@php.net>2002-01-27 07:41:20 +0000
committerJon Parise <jon@php.net>2002-01-27 07:41:20 +0000
commitf174bbc71129ae4baef7138b6cc9a3262d305cb6 (patch)
tree29eeeef9a9d6078a511c172875b1900c9872ea90 /ext/standard/math.c
parentea089d09aef2df9a9d246b2fd2308a105a7debda (diff)
downloadphp-git-f174bbc71129ae4baef7138b6cc9a3262d305cb6.tar.gz
Use the zend_* versions of finite(), isinf(), and isnan(), as defined
in php_config.h. Redefine the zend_* versions in the case of Win32. This fixes the build on systems that don't provide a native version of, say, isinf() (e.g. Solaris).
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 80653a1a55..cfaa7ae964 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -32,9 +32,9 @@
#endif
#ifdef PHP_WIN32
-# define finite(x) _finite(x)
-# define isnan(x) _isnan(x)
-# define isinf(x) _isnan(x)
+# define zend_finite(x) _finite(x)
+# define zend_isnan(x) _isnan(x)
+# define zend_isinf(x) _isnan(x)
#endif
/* {{{ proto int abs(int number)
@@ -393,7 +393,7 @@ PHP_FUNCTION(is_finite)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
return;
}
- RETURN_BOOL(finite(dval));
+ RETURN_BOOL(zend_finite(dval));
}
/* }}} */
@@ -406,7 +406,7 @@ PHP_FUNCTION(is_infinite)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
return;
}
- RETURN_BOOL(isinf(dval));
+ RETURN_BOOL(zend_isinf(dval));
}
/* }}} */
@@ -419,7 +419,7 @@ PHP_FUNCTION(is_nan)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
return;
}
- RETURN_BOOL(isnan(dval));
+ RETURN_BOOL(zend_isnan(dval));
}
/* }}} */
@@ -453,7 +453,7 @@ PHP_FUNCTION(pow)
dval = pow(Z_DVAL_P(zbase),Z_DVAL_P(zexp));
/* if we wanted a long, and dval < LONG_MAX, it must be a long. */
- if (wantlong && finite(dval) && dval <= (double)LONG_MAX) {
+ if (wantlong && zend_finite(dval) && dval <= (double)LONG_MAX) {
RETURN_LONG((long)dval);
}