aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorRainer Emrich <r.emrich@de.tecosim.com>2006-02-07 17:26:54 +0000
committerTobias Schlüter <tobi@gcc.gnu.org>2006-02-07 18:26:54 +0100
commit0e5264e8ea8f3122c6bc6a4d1289c96c4f3a8d63 (patch)
tree848d1540b40be80641b29fe38d4a6f0c8309a285 /libgfortran
parent328654cc923fb727e7a1a3b67d3738b1e30af711 (diff)
downloadgcc-0e5264e8ea8f3122c6bc6a4d1289c96c4f3a8d63.zip
gcc-0e5264e8ea8f3122c6bc6a4d1289c96c4f3a8d63.tar.gz
gcc-0e5264e8ea8f3122c6bc6a4d1289c96c4f3a8d63.tar.bz2
c99_functions.c: Work around incompatible declarations of cabs{,f,l} on pre-C99 IRIX systems.
2006-02-07 Rainer Emrich <r.emrich@de.tecosim.com> * intrinsics/c99_functions.c: Work around incompatible declarations of cabs{,f,l} on pre-C99 IRIX systems. From-SVN: r110700
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/c99_functions.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 4bcdb84..a48b5d8 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-07 Rainer Emrich <r.emrich@de.tecosim.com>
+
+ * intrinsics/c99_functions.c: Work around incompatible
+ declarations of cabs{,f,l} on pre-C99 IRIX systems.
+
2005-02-06 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/23815
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index feb4c08..e26be0e 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -35,6 +35,20 @@ Boston, MA 02110-1301, USA. */
#define C99_PROTOS_H WE_DONT_WANT_PROTOS_NOW
#include "libgfortran.h"
+/* IRIX's <math.h> declares a non-C99 compliant implementation of cabs,
+ which takes two floating point arguments instead of a single complex.
+ If <complex.h> is missing this prevents building of c99_functions.c.
+ To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}. */
+
+#if defined(__sgi__) && !defined(HAVE_COMPLEX_H)
+#undef HAVE_CABS
+#undef HAVE_CABSF
+#undef HAVE_CABSL
+#define cabs __gfc_cabs
+#define cabsf __gfc_cabsf
+#define cabsl __gfc_cabsl
+#endif
+
/* Tru64's <math.h> declares a non-C99 compliant implementation of cabs,
which takes two floating point arguments instead of a single complex.
To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}. */