re PR libfortran/15292 (libgfortran depends on c99 functionality round and roundf)
authorBud Davis <bdavis9659@comcast.net>
Mon, 14 Jun 2004 17:27:20 +0000 (17:27 +0000)
committerBud Davis <bdavis@gcc.gnu.org>
Mon, 14 Jun 2004 17:27:20 +0000 (17:27 +0000)
2004-06-14  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/15292
        * intrinsics/c99_functions.c: Use fpclassify if it exists.

From-SVN: r83116

libgfortran/ChangeLog
libgfortran/intrinsics/c99_functions.c

index 05024399d541d465ba390000ff81b0664a2ba5b2..f0e7d8d7483eaf0de8947295d3afdcb3ccc7490c 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-14  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/15292
+       * intrinsics/c99_functions.c: Use fpclassify if it exists.
+
 2004-06-13  Paul Brook  <paul@codesourcery.com>
 
        * Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
index 932838780b83b3da8e47cd520d29c1d90b1a456d..69b6c3e2e96f592e123fce710efe5640fcbbfaed 100644 (file)
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA.  */
 #include "libgfortran.h"
 
 
+/* Note that if HAVE_FPCLASSIFY is not defined, then NaN is not handled */
+
 /* Algorithm by Steven G. Kargl.  */
 
 #ifndef HAVE_ROUND
@@ -34,11 +36,12 @@ double
 round(double x)
 {
    double t;
+#ifdef HAVE_FPCLASSIFY
    int i;
-
    i = fpclassify(x);
    if (i == FP_INFINITE || i == FP_NAN)
      return (x);
+#endif
 
    if (x >= 0.0) 
     {
@@ -65,11 +68,13 @@ float
 roundf(float x)
 {
    float t;
+#ifdef HAVE_FPCLASSIFY
    int i;
 
    i = fpclassify(x);
    if (i == FP_INFINITE || i == FP_NAN)
      return (x);
+#endif
 
    if (x >= 0.0) 
     {