wok-current view microperl/stuff/perl-5.24.4-math-fix.patch @ rev 25634
Mass update, new toolchain gcc 8.3.0, glibc 2.28.0
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Jan 14 08:12:37 2024 +0000 (20 months ago) |
parents | |
children |
line source
1 --- a/perl.h
2 +++ b/perl.h
3 @@ -2337,6 +2337,26 @@
4 (Perl_fp_class_pdenorm(x) || Perl_fp_class_ndenorm(x))
5 #endif
7 +/* We have somehow managed not to define the denormal/subnormal
8 + * detection.
9 + *
10 + * This may happen if the compiler doesn't expose the C99 math like
11 + * the fpclassify() without some special switches. Perl tries to
12 + * stay C89, so for example -std=c99 is not an option.
13 + *
14 + * The Perl_isinf() and Perl_isnan() should have been defined even if
15 + * the C99 isinf() and isnan() are unavailable, and the NV_MIN becomes
16 + * from the C89 DBL_MIN or moral equivalent. */
17 +#if !defined(Perl_fp_class_denorm) && defined(Perl_isinf) && defined(Perl_isnan) && defined(NV_MIN)
18 +# define Perl_fp_class_denorm(x) ((x) != 0.0 && !Perl_isinf(x) && !Perl_isnan(x) && PERL_ABS(x) < NV_MIN)
19 +#endif
20 +
21 +/* This is not a great fallback: subnormals tests will fail,
22 + * but at least Perl will link and 99.999% of tests will work. */
23 +#if !defined(Perl_fp_class_denorm)
24 +# define Perl_fp_class_denorm(x) FALSE
25 +#endif
26 +
27 #ifdef UNDER_CE
28 int isnan(double d);
29 #endif