This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IRIX long double: use the C99/C11-style generic math macros.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 12:05:19 +0000 (08:05 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 13:02:34 +0000 (09:02 -0400)
Without this the IRIX libmath _isinfl/_isnanl APIs are not used,
and the explicit comparison against NV_MAX/-NV_MAX is used instead,
which seems to work, but is definitely ickier and probably slower.

In the ideal world we could have a Configure test for these math macros.

perl.h

diff --git a/perl.h b/perl.h
index c14ba06..620028d 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1965,11 +1965,15 @@ extern long double Perl_my_frexpl(long double x, int *e);
 #   ifndef Perl_isnan
 #       if defined(HAS_ISNANL) && !(defined(isnan) && defined(HAS_C99))
 #           define Perl_isnan(x) isnanl(x)
+#       elif defined(__sgi) && defined(__c99)  /* XXX Configure test needed */
+#           define Perl_isnan(x) isnan(x)
 #       endif
 #   endif
 #   ifndef Perl_isinf
 #       if defined(HAS_ISINFL) && !(defined(isinf) && defined(HAS_C99))
 #           define Perl_isinf(x) isinfl(x)
+#       elif defined(__sgi) && defined(__c99)  /* XXX Configure test needed */
+#           define Perl_isinf(x) isinf(x)
 #       elif defined(LDBL_MAX) && !defined(NAN_COMPARE_BROKEN)
 #           define Perl_isinf(x) ((x) > LDBL_MAX || (x) < -LDBL_MAX)
 #       endif