OSDN Git Service

* libgfortran/intrinsics/ctime.c: Include <stdlib.h>.
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / rrspacing_r16.c
index 10de244..470541e 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the RRSPACING intrinsic
-   Copyright 2006, 2007, 2009 Free Software Foundation, Inc.
+   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -26,7 +26,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "libgfortran.h"
 
 
-#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FABSL) && defined (HAVE_FREXPL)
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
 
 extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p);
 export_proto(rrspacing_r16);
@@ -36,14 +43,14 @@ rrspacing_r16 (GFC_REAL_16 s, int p)
 {
   int e;
   GFC_REAL_16 x;
-  x = fabsl (s);
+  x = MATHFUNC(fabs) (s);
   if (x == 0.)
     return 0.;
-  frexpl (s, &e);
-#if defined (HAVE_LDEXPL)
-  return ldexpl (x, p - e);
+  MATHFUNC(frexp) (s, &e);
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
+  return MATHFUNC(ldexp) (x, p - e);
 #else
-  return scalbnl (x, p - e);
+  return MATHFUNC(scalbn) (x, p - e);
 #endif
 
 }