]> granicus.if.org Git - php/commitdiff
Fixed bug #28508 (Do not make hypot() available if not supported by libc).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 24 May 2004 17:02:12 +0000 (17:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 24 May 2004 17:02:12 +0000 (17:02 +0000)
ext/standard/basic_functions.c
ext/standard/math.c
ext/standard/php_math.h

index 96d3c6bb348b27af23ee26db00fc965b1d3bf86a..1c31c2766d2d9180519dd72543cca2ac7b84468d 100644 (file)
@@ -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)
index 7163bfa9c563d37378e6c982bee428d250ee11b2..eee11534d5a8a6194ff17fab56b1c1aebf0a1e40 100644 (file)
@@ -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
 
 /* }}} */
 
index adbc9f8cdf1556b6600be2f21218c1ddb5c18886..2f1c00578756a490c53e9faaeb450e87a6635a45 100644 (file)
@@ -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);