[PATCH] AIX fixincludes for complex.h

David Edelsohn dje.gcc@gmail.com
Tue Aug 11 14:32:00 GMT 2009


The complex.h head in AIX refers to a feature for imaginary numbers
that is provided by XLC without protecting the usage.  This was
exposed with a recent change to libgfortran c99_functions.c.  I have
opened an AIX defect, but also need to fix this for current systems
using fixincludes.

I cannot fully run autogen on AIX.  I generated the new fixincl.x on a
Linux system, copied it to AIX and it correctly patches the file.  I
am not sure how to update the base files given the autogen limitations
of AIX.

Bootstrapped on powerpc-ibm-aix5.3.0.0.

Okay?

Thanks, David



        * inclhack.def (aix_complex): New fix.
        * fixincl.x: Regenerate.

Index: inclhack.def
===================================================================
--- inclhack.def        (revision 150639)
+++ inclhack.def        (working copy)
@@ -356,6 +356,23 @@


 /*
+ * complex.h on AIX 5 and AIX 6 define _Complex_I and I in terms of __I,
+ * which only is provided by AIX xlc C99.
+ */
+fix = {
+    hackname  = aix_complex;
+    files     = complex.h;
+    select    = "AIX xlc C99";
+
+    sed       = "s/^#define[ \t]_Complex_I[ \t]__I//";
+    sed       = "s/^#define[ \t]I[ \t]_Complex_I//";
+
+    test_text = "#define _Complex_I    __I\n"
+               "#define I _Complex_I";
+};
+
+
+/*
  *  pthread.h on AIX 4.3.3 tries to define a macro without whitspace
  *  which violates a requirement of ISO C.
  */



More information about the Gcc-patches mailing list