From 03edfa1677a0827a0d391a54213b5c485105ac08 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 24 May 2004 17:02:31 +0000 Subject: MFH: Fixed bug #28508 (Do not make hypot() available if not supported by libc). --- NEWS | 2 ++ ext/standard/basic_functions.c | 2 ++ ext/standard/math.c | 4 ++-- ext/standard/php_math.h | 2 ++ 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); -- cgit v1.2.1