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 = {

Reply via email to