This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 <>

        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)
-# 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

+#if defined(EXP) && defined(TRUNC)
 extern TYPE KIND_SUFFIX(erfc_scaled_r,KIND) (TYPE);

@@ -167,6 +179,8 @@
   return res;

 #undef EXP
 #undef TRUNC

François-Xavier Coudert

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]