Browse Source

Fixed bug #28508 (Do not make hypot() available if not supported by libc).

PHP-5.0
Ilia Alshanetsky 22 years ago
parent
commit
396bf39311
  1. 2
      ext/standard/basic_functions.c
  2. 4
      ext/standard/math.c
  3. 2
      ext/standard/php_math.h

2
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)

4
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
/* }}} */

2
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);

Loading…
Cancel
Save