diff options
author | Josh Martin <josh.martin@abq.sc.philips.com> | 2001-09-13 02:13:41 +0000 |
---|---|---|
committer | Bruce Korb <korbb@gcc.gnu.org> | 2001-09-13 02:13:41 +0000 |
commit | 34b3b0f6884ae57515e63a4e0720d5ad10fe651c (patch) | |
tree | 19dd2dd5ee7ed129be9078ed669e5eed9136a520 /gcc | |
parent | c1d4e7e179b75e2a8674164a36f1290b5062079e (diff) | |
download | gcc-34b3b0f6884ae57515e63a4e0720d5ad10fe651c.zip gcc-34b3b0f6884ae57515e63a4e0720d5ad10fe651c.tar.gz gcc-34b3b0f6884ae57515e63a4e0720d5ad10fe651c.tar.bz2 |
Keep HP-UX headers from defining __size_t and leaving size_t undefined.
From-SVN: r45572
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fixinc/fixincl.x | 49 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.def | 20 |
3 files changed, 71 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1f156e..cab4006 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-09-12 Josh Martin <josh.martin@abq.sc.philips.com> + + * fixinc/inclhack.def(hpux11_size_t): Keep HP-UX headers from + defining __size_t and leaving size_t undefined. + 2001-09-12 Diego Novillo <dnovillo@redhat.com> * basic-block.h (expunge_block): Declare. diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 79b3e7e..32e8e71 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -5,7 +5,7 @@ * files which are fixed to work correctly with ANSI C and placed in a * directory that GNU C will search. * - * This file contains 144 fixup descriptions. + * This file contains 145 fixup descriptions. * * See README for more information. * @@ -2068,6 +2068,43 @@ static const char* apzHpux11_FabsfPatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Hpux11_Size_T fix + */ +tSCC zHpux11_Size_TName[] = + "hpux11_size_t"; + +/* + * File name selection pattern + */ +#define zHpux11_Size_TList (char*)NULL +/* + * Machine/OS name selection pattern + */ +tSCC* apzHpux11_Size_TMachs[] = { + "*-hp-hpux*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zHpux11_Size_TSelect0[] = + "^#define __size_t size_t"; + +#define HPUX11_SIZE_T_TEST_CT 1 +static tTestDesc aHpux11_Size_TTests[] = { + { TT_EGREP, zHpux11_Size_TSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Hpux11_Size_T + */ +static const char* apzHpux11_Size_TPatch[] = { + "format", + "_hpux_size_t", + "__size_t", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Hpux11_Uint32_C fix */ tSCC zHpux11_Uint32_CName[] = @@ -5614,9 +5651,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 151 +#define REGEX_COUNT 152 #define MACH_LIST_SIZE_LIMIT 279 -#define FIX_COUNT 144 +#define FIX_COUNT 145 /* * Enumerate the fixes @@ -5673,6 +5710,7 @@ typedef enum { HPUX10_CPP_POW_INLINE_FIXIDX, HPUX11_CPP_POW_INLINE_FIXIDX, HPUX11_FABSF_FIXIDX, + HPUX11_SIZE_T_FIXIDX, HPUX11_UINT32_C_FIXIDX, HPUX11_VSNPRINTF_FIXIDX, HPUX8_BOGUS_INLINES_FIXIDX, @@ -6024,6 +6062,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aHpux11_FabsfTests, apzHpux11_FabsfPatch, 0 }, + { zHpux11_Size_TName, zHpux11_Size_TList, + apzHpux11_Size_TMachs, + HPUX11_SIZE_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aHpux11_Size_TTests, apzHpux11_Size_TPatch, 0 }, + { zHpux11_Uint32_CName, zHpux11_Uint32_CList, apzHpux11_Uint32_CMachs, HPUX11_UINT32_C_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 40194e2..ef776e2 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -1195,6 +1195,7 @@ fix = { " }\n"; }; + /* * Keep HP-UX 11 from stomping on C++ math namespace * with defines for fabsf. @@ -1216,6 +1217,25 @@ fix = { /* + * Prevent HP-UX 11 from defining __size_t and preventing size_t from + * being defined by having it define _hpux_size_t instead. + */ +fix = { + hackname = hpux11_size_t; + mach = "*-hp-hpux*"; + select = "^#define __size_t size_t"; + + c_fix = format; + c_fix_arg = "_hpux_size_t"; + c_fix_arg = "__size_t"; + + test_text = + "#define __size_t size_t\n" + " extern int getpwuid_r( char *, __size_t, struct passwd **);\n"; +}; + + +/* * In inttypes.h on HPUX 11, the use of __CONCAT__ in the definition * of UINT32_C has undefined behavior according to ISO/ANSI: * the arguments to __CONCAT__ are not macro expanded before the |