summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-09-01 10:06:10 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-09-01 14:13:17 -0400
commitefcbf317d0eb22b93b2044fd752161f57b55dd65 (patch)
treeca75fedf61dd881a0326fff311635c3e4a072527 /perl.h
parenta985cadd390dc83e2be80ce22961ff6da5e6feb5 (diff)
downloadperl-efcbf317d0eb22b93b2044fd752161f57b55dd65.tar.gz
Perl_isinf and Perl_isfinite fallbacks.
(We have so many fallbacks that some of them probably never deploy.)
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 6bc9fcce27..36ecb50798 100644
--- a/perl.h
+++ b/perl.h
@@ -1932,6 +1932,8 @@ EXTERN_C long double modfl(long double, long double *);
# ifndef Perl_isinf
# if defined(HAS_ISINFL) && !(defined(isinf) && HAS_C99)
# define Perl_isinf(x) isinfl(x)
+# elif defined(LDBL_MAX)
+# define Perl_isinf(x) ((x) > LDBL_MAX || (x) < -LDBL_MAX)
# endif
# endif
# if !defined(Perl_isfinite) && !(defined(isfinite) && HAS_C99)
@@ -1939,6 +1941,8 @@ EXTERN_C long double modfl(long double, long double *);
# define Perl_isfinite(x) isfinitel(x)
# elif defined(HAS_FINITEL)
# define Perl_isfinite(x) finitel(x)
+# elif defined(LDBL_MAX)
+# define Perl_isfinite(x) ((x) <= LDBL_MAX && (x) >= -LDBL_MAX)
# endif
# endif
#else
@@ -1996,6 +2000,8 @@ EXTERN_C long double modfl(long double, long double *);
# ifndef Perl_isinf
# if defined(HAS_ISINF)
# define Perl_isinf(x) isinf(x)
+# elif defined(DBL_MAX)
+# define Perl_isinf(x) ((x) > DBL_MAX || (x) < -DBL_MAX)
# endif
# endif
# ifndef Perl_isfinite
@@ -2003,6 +2009,8 @@ EXTERN_C long double modfl(long double, long double *);
# define Perl_isfinite(x) isfinite(x)
# elif defined(HAS_FINITE)
# define Perl_isfinite(x) finite(x)
+# elif defined(DBL_MAX)
+# define Perl_isfinite(x) ((x) <= DBL_MAX && (x) >= -DBL_MAX)
# endif
# endif
#endif