This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: [patch] PR22097: libgfortran build failure on mips-sgi-irix6.5


Roger Sayle schrieb:
> 
> The remaining question is whether the libgfortran maintainers are
> happy with the style of this patch.  For example, it could be
> simplified to
> 
> #if defined(__sgi__) && !defined(HAVE_COMPLEX_H)
> 
> and maybe even combined with the Tru64 test to reduce code:
> 
> #if defined(__osf__) || (defined(__sgi__) && !defined(HAVE_COMPLEX_H))
> 
> 
> FYI, just for the record Tru64 doesn't define HAVE_COMPLEX_H, not that
> it should matter.
> 
> Rainer, you also need to provide a ChangeLog entry for your patch
> submissions, perhaps something like:
> 
> 
> 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.
> 
> 

Okay, second try.

Rainer


diff -rup gcc-4.1-svn/libgfortran/ChangeLog gcc-4.1-test/libgfortran/ChangeLog
--- gcc-4.1-svn/libgfortran/ChangeLog	2006-01-30 11:03:49.000000000 +0100
+++ gcc-4.1-test/libgfortran/ChangeLog	2006-02-07 17:21:28.000000000 +0100
@@ -1,3 +1,9 @@
+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.
+		
+		
 2006-01-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

 	PR libgfortran/25835
diff -rup gcc-4.1-svn/libgfortran/intrinsics/c99_functions.c
gcc-4.1-test/libgfortran/intrinsics/c99_functions.c
--- gcc-4.1-svn/libgfortran/intrinsics/c99_functions.c	2006-01-17
22:12:03.000000000 +0100
+++ gcc-4.1-test/libgfortran/intrinsics/c99_functions.c	2006-02-07
17:20:15.000000000 +0100
@@ -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}.  */



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