From 5b3d96f24f363d74c9f505d1e4c24a01db95de8c Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 23 Jul 2018 20:51:50 +0000 Subject: [PATCH] inclhack.def (aix_unistd): New. * inclhack.def (aix_unistd): New. * fixincl.x: Regenerate. * tests/base/unistd.h [AIX_UNISTD_CHECK]: New test. From-SVN: r262936 --- fixincludes/ChangeLog | 6 ++++ fixincludes/fixincl.x | 53 +++++++++++++++++++++++++++++---- fixincludes/inclhack.def | 14 +++++++++ fixincludes/tests/base/unistd.h | 5 ++++ 4 files changed, 73 insertions(+), 5 deletions(-) diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index d4ac19c0a16..8dade5c657d 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,9 @@ +2018-07-23 David Edelsohn + + * inclhack.def (aix_unistd): New. + * fixincl.x: Regenerate. + * tests/base/unistd.h [AIX_UNISTD_CHECK]: New test. + 2018-06-27 Rasmus Villemoes * tests/base/ioLib.h [VXWORKS_IOLIB_INCLUDE_UNISTD_CHECK]: Add diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 2f7e6fc2443..a5d7884a62a 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed June 12, 2018 at 08:56:43 AM by AutoGen 5.18.12 + * It has been AutoGen-ed July 23, 2018 at 07:27:34 PM by AutoGen 5.18 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Jun 12 08:56:43 MDT 2018 +/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Jul 23 19:27:34 UTC 2018 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 250 fixup descriptions. + * This file contains 251 fixup descriptions. * * See README for more information. * @@ -1806,6 +1806,43 @@ static const char* apzAix_VolatilePatch[] = { "typedef int sig_atomic_t", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Aix_Unistd fix + */ +tSCC zAix_UnistdName[] = + "aix_unistd"; + +/* + * File name selection pattern + */ +tSCC zAix_UnistdList[] = + "unistd.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzAix_UnistdMachs[] = { + "*-*-aix*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zAix_UnistdSelect0[] = + "[ \t]+static[ \t]+int[ \t]+getdtablesize\\(\\)"; + +#define AIX_UNISTD_TEST_CT 1 +static tTestDesc aAix_UnistdTests[] = { + { TT_EGREP, zAix_UnistdSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Aix_Unistd + */ +static const char* apzAix_UnistdPatch[] = { + "format", + "\tstatic int\t\tgetdtablesize(void)", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Alpha___Assert fix @@ -10141,9 +10178,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 288 +#define REGEX_COUNT 289 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 250 +#define FIX_COUNT 251 /* * Enumerate the fixes @@ -10190,6 +10227,7 @@ typedef enum { AIX_SYSMACHINE_FIXIDX, AIX_SYSWAIT_2_FIXIDX, AIX_VOLATILE_FIXIDX, + AIX_UNISTD_FIXIDX, ALPHA___ASSERT_FIXIDX, ALPHA_ASSERT_FIXIDX, ALPHA_GETOPT_FIXIDX, @@ -10607,6 +10645,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { AIX_VOLATILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aAix_VolatileTests, apzAix_VolatilePatch, 0 }, + { zAix_UnistdName, zAix_UnistdList, + apzAix_UnistdMachs, + AIX_UNISTD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aAix_UnistdTests, apzAix_UnistdPatch, 0 }, + { zAlpha___AssertName, zAlpha___AssertList, apzAlpha___AssertMachs, ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index c1f5a13eda4..4ce8b16e0a6 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -923,6 +923,20 @@ fix = { test_text = "typedef volatile int sig_atomic_t;"; }; +/* + * 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. */ diff --git a/fixincludes/tests/base/unistd.h b/fixincludes/tests/base/unistd.h index 756451d837b..263df8f336b 100644 --- a/fixincludes/tests/base/unistd.h +++ b/fixincludes/tests/base/unistd.h @@ -9,6 +9,11 @@ +#if defined( AIX_UNISTD_CHECK ) + static int getdtablesize(void) +#endif /* AIX_UNISTD_CHECK */ + + #if defined( ALPHA_SBRK_CHECK ) extern void *sbrk(ptrdiff_t increment); #endif /* ALPHA_SBRK_CHECK */ -- 2.30.2