cvs: php4 /ext/standard math.c
| From: | Jon Parise | Date: | Sun, 27 Jan 2002 07:41:21 +0000 |
| Subject: | cvs: php4 /ext/standard math.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9196@lists.php.net to get a copy of this message | ||
jon Sun Jan 27 02:41:21 2002 EDT
Modified files:
/php4/ext/standard math.c
Log:
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).
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.74 php4/ext/standard/math.c:1.75
--- php4/ext/standard/math.c:1.74 Wed Jan 9 18:59:04 2002
+++ php4/ext/standard/math.c Sun Jan 27 02:41:20 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.74 2002/01/09 23:59:04 jimw Exp $ */
+/* $Id: math.c,v 1.75 2002/01/27 07:41:20 jon Exp $ */
#include "php.h"
#include "php_math.h"
@@ -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 @@
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 @@
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 @@
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 @@
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);
}