This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libgfortran,committed] Don't use expl() unconditionally (PR35524)
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Mar 2008 10:27:28 +0000
- Subject: [libgfortran,committed] Don't use expl() unconditionally (PR35524)
Patch below committed as rev. 133138 under the "obvious" rule to fix
PR 35524: my F2008 patch did use expl() inconditionally to provide
the long double version of ERFC_SCALED; this caused issues on
FreeBSD, which does not have C99 long double variants of math
functions --- I strongly suspect they're keeping them for the 10th
anniversary of C99, next year :)
2008-03-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/35524
* intrinsics/erfc_scaled_inc.c: Only define the long double
variant of erfc_scaled if expl is available.
Index: intrinsics/erfc_scaled_inc.c
===================================================================
--- intrinsics/erfc_scaled_inc.c (revision 133137)
+++ intrinsics/erfc_scaled_inc.c (working copy)
@@ -35,16 +35,28 @@
#define KIND_SUFFIX(x,y) CONCAT(x,y)
#if (KIND == 4)
+
# define EXP(x) expf(x)
# define TRUNC(x) truncf(x)
+
#elif (KIND == 8)
+
# define EXP(x) exp(x)
# define TRUNC(x) trunc(x)
+
#else
-# define EXP(x) expl(x)
-# define TRUNC(x) truncl(x)
+
+# ifdef HAVE_EXPL
+# define EXP(x) expl(x)
+# endif
+# ifdef HAVE_TRUNCL
+# define TRUNC(x) truncl(x)
+# endif
+
#endif
+#if defined(EXP) && defined(TRUNC)
+
extern TYPE KIND_SUFFIX(erfc_scaled_r,KIND) (TYPE);
export_proto(KIND_SUFFIX(erfc_scaled_r,KIND));
@@ -167,6 +179,8 @@
return res;
}
+#endif
+
#undef EXP
#undef TRUNC
--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/