aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorBud Davis <bdavis9659@comcast.net>2004-06-14 17:27:20 +0000
committerBud Davis <bdavis@gcc.gnu.org>2004-06-14 17:27:20 +0000
commitbc20e36d1659487e7975ddd1fb18e53867149e8f (patch)
tree3999fa2fb387b4492c2311669e6e057592060f00 /libgfortran
parentce738b86f9cb4e73b7e7458c8e9a6c4865aa187b (diff)
downloadgcc-bc20e36d1659487e7975ddd1fb18e53867149e8f.zip
gcc-bc20e36d1659487e7975ddd1fb18e53867149e8f.tar.gz
gcc-bc20e36d1659487e7975ddd1fb18e53867149e8f.tar.bz2
re PR libfortran/15292 (libgfortran depends on c99 functionality round and roundf)
2004-06-14 Bud Davis <bdavis9659@comcast.net> PR gfortran/15292 * intrinsics/c99_functions.c: Use fpclassify if it exists. From-SVN: r83116
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/c99_functions.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0502439..f0e7d8d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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.
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 9328387..69b6c3e 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -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)
{