From: Jon Parise Date: Sun, 27 Jan 2002 07:41:20 +0000 (+0000) Subject: Use the zend_* versions of finite(), isinf(), and isnan(), as defined X-Git-Tag: PRE_ISSET_PATCH~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f174bbc71129ae4baef7138b6cc9a3262d305cb6;p=php 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). --- 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); }