Skip to content

Commit 03edfa1

Browse files
author
Ilia Alshanetsky
committed
MFH: Fixed bug #28508 (Do not make hypot() available if not supported by
libc).
1 parent 1a9d759 commit 03edfa1

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ PHP 4 NEWS
1313
- Fixed bug #28456 (Problem with enclosed / in uploaded files). (Antony)
1414
- Fixed logic bug in session_register() which allowed registering _SESSION
1515
and/or HTTP_SESSION_VARS. (Sara)
16+
- Fixed bug #28508 (Do not make hypot() available if not supported by libc).
17+
(Ilia)
1618
- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia)
1719
- Fixed bug #28374 (Possible unterminated loop inside
1820
_php_pgsql_trim_message()). (Ilia)

ext/standard/basic_functions.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ function_entry basic_functions[] = {
494494
PHP_FE(log, NULL)
495495
PHP_FE(log10, NULL)
496496
PHP_FE(sqrt, NULL)
497+
#ifdef HAVE_HYPOT
497498
PHP_FE(hypot, NULL)
499+
#endif
498500
PHP_FE(deg2rad, NULL)
499501
PHP_FE(rad2deg, NULL)
500502
PHP_FE(bindec, NULL)

ext/standard/math.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ PHP_FUNCTION(sqrt)
622622
disappear in the next version of PHP!
623623
*/
624624

625+
#ifdef HAVE_HYPOT
625626
PHP_FUNCTION(hypot)
626627
{
627-
#ifdef HAVE_HYPOT
628628
zval **num1, **num2;
629629

630630
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &num1, &num2) == FAILURE) {
@@ -634,8 +634,8 @@ PHP_FUNCTION(hypot)
634634
convert_to_double_ex(num2);
635635
Z_DVAL_P(return_value) = hypot(Z_DVAL_PP(num1), Z_DVAL_PP(num2));
636636
Z_TYPE_P(return_value) = IS_DOUBLE;
637-
#endif
638637
}
638+
#endif
639639

640640
/* }}} */
641641

ext/standard/php_math.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ PHP_FUNCTION(rad2deg);
6666
WARNING: these functions are expermental: they could change their names or
6767
disappear in the next version of PHP!
6868
*/
69+
#ifdef HAVE_HYPOT
6970
PHP_FUNCTION(hypot);
71+
#endif
7072
PHP_FUNCTION(expm1);
7173
PHP_FUNCTION(log1p);
7274

0 commit comments

Comments
 (0)