summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-05-24 17:02:31 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-05-24 17:02:31 +0000
commit03edfa1677a0827a0d391a54213b5c485105ac08 (patch)
treeb68958d4531635f59c46ccd155bd475561ae9b31
parent1a9d759fc4ca54a2ba292c9fc6529a382927083d (diff)
downloadphp-git-03edfa1677a0827a0d391a54213b5c485105ac08.tar.gz
MFH: Fixed bug #28508 (Do not make hypot() available if not supported by
libc).
-rw-r--r--NEWS2
-rw-r--r--ext/standard/basic_functions.c2
-rw-r--r--ext/standard/math.c4
-rw-r--r--ext/standard/php_math.h2
4 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 162244a106..e7e52dc0b9 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ PHP 4 NEWS
- Fixed bug #28456 (Problem with enclosed / in uploaded files). (Antony)
- Fixed logic bug in session_register() which allowed registering _SESSION
and/or HTTP_SESSION_VARS. (Sara)
+- Fixed bug #28508 (Do not make hypot() available if not supported by libc).
+ (Ilia)
- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia)
- Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()). (Ilia)
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 5e4e20d13e..731ddd4942 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -494,7 +494,9 @@ function_entry basic_functions[] = {
PHP_FE(log, NULL)
PHP_FE(log10, NULL)
PHP_FE(sqrt, NULL)
+#ifdef HAVE_HYPOT
PHP_FE(hypot, NULL)
+#endif
PHP_FE(deg2rad, NULL)
PHP_FE(rad2deg, NULL)
PHP_FE(bindec, NULL)
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 76797a8e7b..49970d4683 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -622,9 +622,9 @@ PHP_FUNCTION(sqrt)
disappear in the next version of PHP!
*/
+#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot)
{
-#ifdef HAVE_HYPOT
zval **num1, **num2;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) == FAILURE) {
@@ -634,8 +634,8 @@ PHP_FUNCTION(hypot)
convert_to_double_ex(num2);
Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
Z_TYPE_P(return_value) = IS_DOUBLE;
-#endif
}
+#endif
/* }}} */
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 12e8224a12..4b1620196a 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -66,7 +66,9 @@ PHP_FUNCTION(rad2deg);
WARNING: these functions are expermental: they could change their names or
disappear in the next version of PHP!
*/
+#ifdef HAVE_HYPOT
PHP_FUNCTION(hypot);
+#endif
PHP_FUNCTION(expm1);
PHP_FUNCTION(log1p);