Message ID | CAGWvnymHB6ewMagdT214cOBpC1pbBMszRYfmE5zUSbQ5HMbaSA@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [fixincludes] AIX unistd header | expand |
Looks good to me. On Mon, Jul 23, 2018 at 1:50 PM David Edelsohn <dje.gcc@gmail.com> wrote: > > AIX unistd.h defines a static function without a parameter, which > justifiably upsets C++ code when the header is included and > referenced. This patch to fixincludes adjusts the header to declare > the parameter as void. > > Bootstrapped on powerpc-ibm-aix7.2.0.0 and powerpc64le-linux > > Thanks, David > > * inclhack.def (aix_unistd): New. > * fixincl.x: Regenerate. > * tests/base/unistd.h [AIX_UNISTD_CHECK]: New test. > > Index: inclhack.def > =================================================================== > --- inclhack.def (revision 262934) > +++ inclhack.def (working copy) > @@ -924,6 +924,20 @@ > }; > > /* > + * AIX unistd.h defines a static function with an empty parameter list. > + */ > +fix = { > + hackname = aix_unistd; > + mach = "*-*-aix*"; > + files = unistd.h; > + > + select = "[ \t]+static[ \t]+int[ \t]+getdtablesize\\(\\)"; > + c_fix = format; > + c_fix_arg = "\tstatic int\t\tgetdtablesize(void)"; > + test_text = " static int getdtablesize()"; > +}; > + > +/* > * Fix __assert declaration in assert.h on Alpha OSF/1. > */ > fix = {
Index: inclhack.def =================================================================== --- inclhack.def (revision 262934) +++ inclhack.def (working copy) @@ -924,6 +924,20 @@ }; /* + * AIX unistd.h defines a static function with an empty parameter list. + */ +fix = { + hackname = aix_unistd; + mach = "*-*-aix*"; + files = unistd.h; + + select = "[ \t]+static[ \t]+int[ \t]+getdtablesize\\(\\)"; + c_fix = format; + c_fix_arg = "\tstatic int\t\tgetdtablesize(void)"; + test_text = " static int getdtablesize()"; +}; + +/* * Fix __assert declaration in assert.h on Alpha OSF/1. */ fix = {