Looks good to me...

On Thu, Aug 13, 2015 at 10:33 AM, David Edelsohn <dje....@gmail.com> wrote:
> AIX stdio.h header includes code specific for C++ that looks like:
>
> extern "C" {
> #ifdef __cplusplus
> #ifdef ferror
> #undef ferror
> inline int ferror(FILE * _p)
> {
>         return ((_p)->_flag & _IOERR);
> }
> #endif /*ferror*/
>
> which generates code that makes the AIX linker and loader rather upset
> because the inline function is not mangled and conflicts with the C
> library.
>
> This fixincludes patch protects this code with an addition test for
> IBMCPP (not that IBMCPP will use GCC include-fixed headers, but ....).
>
> Okay?
>
> Thanks, David
>
> * inclhack.def (aix_stdio_inline): New fix.
> * fixincl.x: Regenerated.
> * test/base/stdio.h [AIX_STDIO_INLINE]: New test.
>
> Index: inclhack.def
> ===================================================================
> --- inclhack.def    (revision 226860)
> +++ inclhack.def    (working copy)
> @@ -892,10 +892,32 @@
>  };
>
>  /*
> + * stdio.h on AIX defines ferror, clearerr and feof as C++ inline, which
> +   produces wrong code with G++.
> + */
> +fix = {
> +    hackname  = aix_stdio_inline;
> +    mach      = "*-*-aix*";
> +    files     = stdio.h;
> +    select    = "#ifdef __cplusplus\\\n"
> +                "}\\\n\\\n"
> +                "#ifdef ferror\\\n";
> +    c_fix     = format;
> +    c_fix_arg = "#ifdef __cplusplus\n"
> +                "}\n"
> +                "#endif\n\n"
> +                "#if (defined(__cplusplus) && defined(__IBMCPP__))\n"
> +                "#ifdef ferror\n";
> +    test_text = "#ifdef __cplusplus\n}\n\n#ifdef ferror";
> +};
> +
> +
> +/*

Reply via email to