]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c99_functions.c: Work around incompatible declarations of cabs{,f,l} on pre-C99 IRIX...
authorRainer Emrich <r.emrich@de.tecosim.com>
Tue, 7 Feb 2006 17:26:54 +0000 (17:26 +0000)
committerTobias Schlüter <tobi@gcc.gnu.org>
Tue, 7 Feb 2006 17:26:54 +0000 (18:26 +0100)
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

libgfortran/ChangeLog
libgfortran/intrinsics/c99_functions.c

index 4bcdb84667de1f78f09f656ee0b4c4169aa797ef..a48b5d800686689d6130acde77d9f533a84009df 100644 (file)
@@ -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
index feb4c08b4791f4357300b2d2841249f0fcd45d6e..e26be0ecdb93a8278a68e993bbdadeef64fdec69 100644 (file)
@@ -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}.  */