summaryrefslogtreecommitdiff
path: root/libgfortran/libgfortran.h
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-03 20:00:00 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-03 20:00:00 +0000
commitc14474b774c007b8780b40b4ca02ac9ea1fbe804 (patch)
treee86054ac99a2ed7631ec270a52b16f1f7ccc07d2 /libgfortran/libgfortran.h
parentfdab6a9067bc0252ecd2252ed54a4f9ebec78a51 (diff)
downloadgcc-c14474b774c007b8780b40b4ca02ac9ea1fbe804.tar.gz
* libgfortran.h: When isfinite is not provided by the system,
define it as a macro, so that it can accept any floating point type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102707 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/libgfortran.h')
-rw-r--r--libgfortran/libgfortran.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index ccba2a764be..6db6ef927cf 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -179,17 +179,11 @@ typedef off_t gfc_offset;
alternatives, or bail out. */
#if (!defined(isfinite) || defined(__CYGWIN__))
#undef isfinite
-static inline int
-isfinite (double x)
-{
#if defined(fpclassify)
- return (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE);
-#elif defined(HAVE_FINITE)
- return finite (x);
+#define isfinite(x) (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
#else
-#error "libgfortran needs isfinite, fpclassify, or finite"
+#define isfinite(x) ((x) - (x) == 0)
#endif
-}
#endif /* !defined(isfinite) */
/* TODO: find the C99 version of these an move into above ifdef. */