From 7d3235372abf6e7e63bb846dec5b44e8efdb8cc0 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 11 Feb 2017 21:11:44 +0000 Subject: [PATCH] alloca.h: New file. * tests/base/alloca.h: New file. * inclhack.def (hppa_hpux11_alloca): New fix. * fixincl.x: Regenerate. From-SVN: r245364 --- fixincludes/ChangeLog | 6 ++++ fixincludes/fixincl.x | 56 ++++++++++++++++++++++++++++++--- fixincludes/inclhack.def | 18 +++++++++++ fixincludes/tests/base/alloca.h | 18 +++++++++++ 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 fixincludes/tests/base/alloca.h diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 60ee208b4ef..218a5a23620 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,9 @@ +2017-02-11 John David Anglin + + * tests/base/alloca.h: New file. + * inclhack.def (hppa_hpux11_alloca): New fix. + * fixincl.x: Regenerate. + 2017-01-17 Jakub Jelinek PR other/79046 diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 6a010d6b706..ece2b87ce5b 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 January 12, 2017 at 11:46:34 AM by AutoGen 5.16.2 + * It has been AutoGen-ed Saturday February 11, 2017 at 04:09:01 PM EST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Jan 12 11:46:34 2017 +/* DO NOT SVN-MERGE THIS FILE, EITHER Sat 11 Feb 2017 16:09:01 EST * * 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 246 fixup descriptions. + * This file contains 247 fixup descriptions. * * See README for more information. * @@ -4340,6 +4340,46 @@ static const char* apzHpux10_Stdio_DeclarationsPatch[] = { # endif /* __STDC__) || __cplusplus */\n", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Hppa_Hpux11_Alloca fix + */ +tSCC zHppa_Hpux11_AllocaName[] = + "hppa_hpux11_alloca"; + +/* + * File name selection pattern + */ +tSCC zHppa_Hpux11_AllocaList[] = + "alloca.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzHppa_Hpux11_AllocaMachs[] = { + "hppa*-*-hpux11*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zHppa_Hpux11_AllocaSelect0[] = + "#ifndef _STDDEF_INCLUDED"; + +#define HPPA_HPUX11_ALLOCA_TEST_CT 1 +static tTestDesc aHppa_Hpux11_AllocaTests[] = { + { TT_EGREP, zHppa_Hpux11_AllocaSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Hppa_Hpux11_Alloca + */ +static const char* apzHppa_Hpux11_AllocaPatch[] = { + "format", + "#ifndef _SYS_STDSYMS_INCLUDED\n\ +# include \n\ +#endif /* _SYS_STDSYMS_INCLUDED */\n\n\ +%0", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Hpux11_Abs fix @@ -10062,9 +10102,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 283 +#define REGEX_COUNT 284 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 246 +#define FIX_COUNT 247 /* * Enumerate the fixes @@ -10170,6 +10210,7 @@ typedef enum { HPUX10_CTYPE_DECLARATIONS1_FIXIDX, HPUX10_CTYPE_DECLARATIONS2_FIXIDX, HPUX10_STDIO_DECLARATIONS_FIXIDX, + HPPA_HPUX11_ALLOCA_FIXIDX, HPUX11_ABS_FIXIDX, HPUX11_LWP_RWLOCK_VALID_FIXIDX, HPUX11_EXTERN_SENDFILE_FIXIDX, @@ -10819,6 +10860,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { HPUX10_STDIO_DECLARATIONS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aHpux10_Stdio_DeclarationsTests, apzHpux10_Stdio_DeclarationsPatch, 0 }, + { zHppa_Hpux11_AllocaName, zHppa_Hpux11_AllocaList, + apzHppa_Hpux11_AllocaMachs, + HPPA_HPUX11_ALLOCA_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aHppa_Hpux11_AllocaTests, apzHppa_Hpux11_AllocaPatch, 0 }, + { zHpux11_AbsName, zHpux11_AbsList, apzHpux11_AbsMachs, HPUX11_ABS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 03a267bd375..fd12062e165 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2274,6 +2274,24 @@ fix = { test_text = "# define _iob __iob\n"; }; +/* + * The HP-UX stddef.h is replaced by gcc's. It doesn't include sys/stdsyms.h. + * As a result, we need to include sys/stdsyms.h in alloca.h. + */ +fix = { + hackname = hppa_hpux11_alloca; + mach = "hppa*-*-hpux11*"; + files = alloca.h; + select = "#ifndef _STDDEF_INCLUDED"; + c_fix = format; + c_fix_arg = "#ifndef _SYS_STDSYMS_INCLUDED\n" + "# include \n" + "#endif /* _SYS_STDSYMS_INCLUDED */\n\n" + "%0"; + + test_text = "#ifndef _STDDEF_INCLUDED"; +}; + /* * Make sure hpux defines abs in header. */ diff --git a/fixincludes/tests/base/alloca.h b/fixincludes/tests/base/alloca.h new file mode 100644 index 00000000000..3f50b36a96d --- /dev/null +++ b/fixincludes/tests/base/alloca.h @@ -0,0 +1,18 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/alloca.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( HPPA_HPUX11_ALLOCA_CHECK ) +#ifndef _SYS_STDSYMS_INCLUDED +# include +#endif /* _SYS_STDSYMS_INCLUDED */ + +#ifndef _STDDEF_INCLUDED +#endif /* HPPA_HPUX11_ALLOCA_CHECK */ -- 2.30.2