libgfortran.h: When isfinite is not provided by the system...
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Wed, 3 Aug 2005 20:00:00 +0000 (22:00 +0200)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Wed, 3 Aug 2005 20:00:00 +0000 (20:00 +0000)
* libgfortran.h: When isfinite is not provided by the system,
define it as a macro, so that it can accept any floating point
type.

From-SVN: r102707

libgfortran/ChangeLog
libgfortran/libgfortran.h

index cdd3f118216e5a3bd1fe77eb3f03d98780e2d1ac..e725012e0f5d0efbede663bef541150816346459 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       * libgfortran.h: When isfinite is not provided by the system,
+       define it as a macro, so that it can accept any floating point
+       type.
+
 2005-08-01  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/23178
index ccba2a764bee1a1d0eb7abeb77e4f65628344f43..6db6ef927cf8cca3ee361ccf38f3f9cc37ea2d2e 100644 (file)
@@ -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.  */