From: Ilia Alshanetsky Date: Mon, 24 May 2004 17:02:12 +0000 (+0000) Subject: Fixed bug #28508 (Do not make hypot() available if not supported by libc). X-Git-Tag: php-5.0.0RC3RC1~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=396bf393110d54009e7aad6a5b7605be6c1bec8d;p=php Fixed bug #28508 (Do not make hypot() available if not supported by libc). --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 96d3c6bb34..1c31c2766d 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -401,7 +401,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 7163bfa9c5..eee11534d5 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 adbc9f8cdf..2f1c005787 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);