diff options
author | Tony Cook <tony@develop-help.com> | 2018-09-12 11:09:52 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2018-09-12 11:09:52 +1000 |
commit | e6081c0ea8a779f5fdd429d2dfb48bf094bb92c4 (patch) | |
tree | 93030d55d4965871d2c0a5a7ca04a1b2e95006e3 | |
parent | db54010671d6c27faf667d658073743b14cd9b58 (diff) | |
download | perl-e6081c0ea8a779f5fdd429d2dfb48bf094bb92c4.tar.gz |
(perl #133510) use quadmath versions of log10, ldexp and signbit
With -Dquadmath C++ builds, the calls to log10() and ldexp() would
cause ambiguous overloaded function errors, since all of log10(float),
log10(double) and log10(long double) were canidates for a
log10(__float128) call. Similarly for ldexp().
signbit() had a different problem, two of the tests in ext/POSIX/t/math.t
failed with the default signbit() macro, presumably because the
__float128 was being converted to a long double, since the macro in
math.h didn't special case for __float128.
-rw-r--r-- | ext/POSIX/POSIX.xs | 6 | ||||
-rw-r--r-- | ext/POSIX/lib/POSIX.pm | 2 | ||||
-rw-r--r-- | perl.h | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 7497305841..72dcef8dbd 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -2416,7 +2416,7 @@ acos(x) #endif break; case 17: - RETVAL = log10(x); /* C89 math */ + RETVAL = Perl_log10(x); /* C89 math */ break; case 18: #ifdef c99_log1p @@ -2828,6 +2828,10 @@ NV ldexp(x,exp) NV x int exp + CODE: + RETVAL = Perl_ldexp(x, exp); + OUTPUT: + RETVAL void modf(x) diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index ae33cad992..05eedf7b92 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -4,7 +4,7 @@ use warnings; our ($AUTOLOAD, %SIGRT); -our $VERSION = '1.84'; +our $VERSION = '1.85'; require XSLoader; @@ -1943,6 +1943,7 @@ extern long double Perl_my_frexpl(long double x, int *e); # define Perl_fmod fmodq # define Perl_log logq # define Perl_log10 log10q +# define Perl_signbit signbitq # define Perl_pow powq # define Perl_sin sinq # define Perl_sinh sinhq @@ -3838,7 +3839,9 @@ my_swap16(const U16 x) { #define U_L(what) U_32(what) #ifdef HAS_SIGNBIT -# define Perl_signbit signbit +# ifndef Perl_signbit +# define Perl_signbit signbit +# endif #endif /* These do not care about the fractional part, only about the range. */ |