Skip to content

Commit

Permalink
* inclhack.def (solaris_int_limits_3): New fix.
Browse files Browse the repository at this point in the history
	* fixincl.x: Regenerate.
	* tests/base/sys/int_limits.h [SOLARIS_INT_LIMITS_3_CHECK]: New
	test.

	* inclhack.def (solaris_int_const, solaris_int_limits_1,
	solaris_int_limits_2 ): Applies to Solaris 2 in general.
	Remove select.
	Add mach for *-*-solaris2*.
	Change second c_fix_arg to select.
	Remove #pragma ident from test_text.
	* fixincl.x: Regenerate.
	* tests/base/sys/int_const.h [SOLARIS_INT_CONST_CHECK]: Remove
	#pragma trigger text.
	* tests/base/sys/int_limits.h [SOLARIS_INT_LIMITS_1_CHECK,
	SOLARIS_INT_LIMITS_2_CHECK]: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156356 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
ro committed Jan 29, 2010
1 parent 1420395 commit d462c2e
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 32 deletions.
19 changes: 19 additions & 0 deletions fixincludes/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2010-01-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

* inclhack.def (solaris_int_limits_3): New fix.
* fixincl.x: Regenerate.
* tests/base/sys/int_limits.h [SOLARIS_INT_LIMITS_3_CHECK]: New
test.

* inclhack.def (solaris_int_const, solaris_int_limits_1,
solaris_int_limits_2 ): Applies to Solaris 2 in general.
Remove select.
Add mach for *-*-solaris2*.
Change second c_fix_arg to select.
Remove #pragma ident from test_text.
* fixincl.x: Regenerate.
* tests/base/sys/int_const.h [SOLARIS_INT_CONST_CHECK]: Remove
#pragma trigger text.
* tests/base/sys/int_limits.h [SOLARIS_INT_LIMITS_1_CHECK,
SOLARIS_INT_LIMITS_2_CHECK]: Likewise.

2010-01-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

* inclhack.def (aix_stdint_1): Add stdint-aix.h to files.
Expand Down
80 changes: 63 additions & 17 deletions fixincludes/fixincl.x
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been AutoGen-ed Tuesday January 26, 2010 at 08:17:12 PM MET
* It has been AutoGen-ed Friday January 29, 2010 at 04:49:43 PM MET
* From the definitions inclhack.def
* and the template file fixincl
*/
/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Jan 26 20:17:12 MET 2010
/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jan 29 16:49:43 MET 2010
*
* You must regenerate it. Use the ./genfixes script.
*
Expand All @@ -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 204 fixup descriptions.
* This file contains 205 fixup descriptions.
*
* See README for more information.
*
Expand Down Expand Up @@ -6635,13 +6635,17 @@ tSCC zSolaris_Int_ConstList[] =
/*
* Machine/OS name selection pattern
*/
#define apzSolaris_Int_ConstMachs (const char**)NULL
tSCC* apzSolaris_Int_ConstMachs[] = {
"*-*-solaris2*",
(const char*)NULL };

/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Int_ConstSelect0[] =
"@\\(#\\)int_const.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
"^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n\
(/*.**/)\n\
#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*";

#define SOLARIS_INT_CONST_TEST_CT 1
static tTestDesc aSolaris_Int_ConstTests[] = {
Expand All @@ -6655,9 +6659,6 @@ static const char* apzSolaris_Int_ConstPatch[] = {
"#define\tUINT8_C(c)\t(c)\n\
%1\n\
#define\tUINT16_C(c)\t(c)",
"^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n\
(/*.**/)\n\
#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
Expand All @@ -6675,13 +6676,16 @@ tSCC zSolaris_Int_Limits_1List[] =
/*
* Machine/OS name selection pattern
*/
#define apzSolaris_Int_Limits_1Machs (const char**)NULL
tSCC* apzSolaris_Int_Limits_1Machs[] = {
"*-*-solaris2*",
(const char*)NULL };

/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Int_Limits_1Select0[] =
"@\\(#\\)int_limits.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
"^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n\
#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)";

#define SOLARIS_INT_LIMITS_1_TEST_CT 1
static tTestDesc aSolaris_Int_Limits_1Tests[] = {
Expand All @@ -6694,8 +6698,6 @@ static const char* apzSolaris_Int_Limits_1Patch[] = {
"format",
"#define\tUINT8_MAX\t(255)\n\
#define\tUINT16_MAX\t(65535)",
"^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n\
#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
Expand All @@ -6713,13 +6715,15 @@ tSCC zSolaris_Int_Limits_2List[] =
/*
* Machine/OS name selection pattern
*/
#define apzSolaris_Int_Limits_2Machs (const char**)NULL
tSCC* apzSolaris_Int_Limits_2Machs[] = {
"*-*-solaris2*",
(const char*)NULL };

/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Int_Limits_2Select0[] =
"@\\(#\\)int_limits.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
"^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*";

#define SOLARIS_INT_LIMITS_2_TEST_CT 1
static tTestDesc aSolaris_Int_Limits_2Tests[] = {
Expand All @@ -6731,7 +6735,43 @@ static tTestDesc aSolaris_Int_Limits_2Tests[] = {
static const char* apzSolaris_Int_Limits_2Patch[] = {
"format",
"#define\t%1_FAST16_%2 %132_%2",
"^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Solaris_Int_Limits_3 fix
*/
tSCC zSolaris_Int_Limits_3Name[] =
"solaris_int_limits_3";

/*
* File name selection pattern
*/
tSCC zSolaris_Int_Limits_3List[] =
"sys/int_limits.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzSolaris_Int_Limits_3Machs[] = {
"*-*-solaris2*",
(const char*)NULL };

/*
* content selection pattern - do fix if pattern found
*/
tSCC zSolaris_Int_Limits_3Select0[] =
"^#define[ \t]+SIZE_MAX[ \t]+4294967295UL";

#define SOLARIS_INT_LIMITS_3_TEST_CT 1
static tTestDesc aSolaris_Int_Limits_3Tests[] = {
{ TT_EGREP, zSolaris_Int_Limits_3Select0, (regex_t*)NULL }, };

/*
* Fix Command Arguments for Solaris_Int_Limits_3
*/
static const char* apzSolaris_Int_Limits_3Patch[] = {
"format",
"#define\tSIZE_MAX\t4294967295U",
(char*)NULL };

/* * * * * * * * * * * * * * * * * * * * * * * * * *
Expand Down Expand Up @@ -8316,9 +8356,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 244
#define REGEX_COUNT 245
#define MACH_LIST_SIZE_LIMIT 181
#define FIX_COUNT 204
#define FIX_COUNT 205

/*
* Enumerate the fixes
Expand Down Expand Up @@ -8489,6 +8529,7 @@ typedef enum {
SOLARIS_INT_CONST_FIXIDX,
SOLARIS_INT_LIMITS_1_FIXIDX,
SOLARIS_INT_LIMITS_2_FIXIDX,
SOLARIS_INT_LIMITS_3_FIXIDX,
SOLARIS_INT_TYPES_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
STATSSWTCH_FIXIDX,
Expand Down Expand Up @@ -9356,6 +9397,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SOLARIS_INT_LIMITS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Int_Limits_2Tests, apzSolaris_Int_Limits_2Patch, 0 },

{ zSolaris_Int_Limits_3Name, zSolaris_Int_Limits_3List,
apzSolaris_Int_Limits_3Machs,
SOLARIS_INT_LIMITS_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Int_Limits_3Tests, apzSolaris_Int_Limits_3Patch, 0 },

{ zSolaris_Int_TypesName, zSolaris_Int_TypesList,
apzSolaris_Int_TypesMachs,
SOLARIS_INT_TYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
Expand Down
37 changes: 25 additions & 12 deletions fixincludes/inclhack.def
Original file line number Diff line number Diff line change
Expand Up @@ -3522,67 +3522,80 @@ fix = {


/*
* Sun Solaris 10 has a version of sys/int_const.h that defines
* Sun Solaris 2 has a version of sys/int_const.h that defines
* UINT8_C and UINT16_C to unsigned constants.
*/
fix = {
hackname = solaris_int_const;
select = '@\(#\)int_const.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
files = sys/int_const.h;
mach = '*-*-solaris2*';
c_fix = format;
c_fix_arg = "#define\tUINT8_C(c)\t(c)\n"
"%1\n"
"#define\tUINT16_C(c)\t(c)";
c_fix_arg = "^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n"
select = "^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n"
"(/\*.*\*/)\n"
"#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*";
test_text =
'#pragma ident "@(#)int_const.h 1.5 04/09/28 SMI"'"\n"
"#define UINT8_C(c) __CONCAT__(c,u)\n"
"/* CSTYLED */\n"
"#define UINT16_C(c) __CONCAT__(c,u)";
};


/*
* Sun Solaris 10 has a version of sys/int_limits.h that defines
* Sun Solaris 2 has a version of sys/int_limits.h that defines
* UINT8_MAX and UINT16_MAX to unsigned constants.
*/
fix = {
hackname = solaris_int_limits_1;
select = '@\(#\)int_limits.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
files = sys/int_limits.h;
mach = '*-*-solaris2*';
c_fix = format;
c_fix_arg = "#define\tUINT8_MAX\t(255)\n"
"#define\tUINT16_MAX\t(65535)";
c_fix_arg = "^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n"
select = "^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n"
"#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)";
test_text =
'#pragma ident "@(#)int_limits.h 1.9 04/09/28 SMI"'"\n"
"#define UINT8_MAX (255U)\n"
"#define UINT16_MAX (65535U)";
};


/*
* Sun Solaris 10 has a version of sys/int_limits.h that defines
* Sun Solaris 2 has a version of sys/int_limits.h that defines
* INT_FAST16 limits to wrong values for sys/int_types.h.
*/
fix = {
hackname = solaris_int_limits_2;
select = '@\(#\)int_limits.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
files = sys/int_limits.h;
mach = '*-*-solaris2*';
c_fix = format;
c_fix_arg = "#define\t%1_FAST16_%2 %132_%2";
c_fix_arg = "^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*";
select = "^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*";
test_text =
'#pragma ident "@(#)int_limits.h 1.9 04/09/28 SMI"'"\n"
"#define INT_FAST16_MAX INT16_MAX\n"
"#define UINT_FAST16_MAX UINT16_MAX\n"
"#define INT_FAST16_MIN INT16_MIN";
};


/*
* Sun Solaris 2 has a version of sys/int_limits.h that defines
* SIZE_MAX as unsigned long.
*/
fix = {
hackname = solaris_int_limits_3;
files = sys/int_limits.h;
mach = '*-*-solaris2*';
c_fix = format;
c_fix_arg = "#define\tSIZE_MAX\t4294967295U";
select = "^#define[ \t]+SIZE_MAX[ \t]+4294967295UL";
test_text =
"#define SIZE_MAX 4294967295UL";
};


/*
* Sun Solaris up to 9 has a version of sys/int_types.h that forbids use
* of Standard C99 64-bit types in 32-bit mode.
Expand Down
1 change: 0 additions & 1 deletion fixincludes/tests/base/sys/int_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


#if defined( SOLARIS_INT_CONST_CHECK )
#pragma ident "@(#)int_const.h 1.5 04/09/28 SMI"
#define UINT8_C(c) (c)
/* CSTYLED */
#define UINT16_C(c) (c)
Expand Down
7 changes: 5 additions & 2 deletions fixincludes/tests/base/sys/int_limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@


#if defined( SOLARIS_INT_LIMITS_1_CHECK )
#pragma ident "@(#)int_limits.h 1.9 04/09/28 SMI"
#define UINT8_MAX (255)
#define UINT16_MAX (65535)
#endif /* SOLARIS_INT_LIMITS_1_CHECK */


#if defined( SOLARIS_INT_LIMITS_2_CHECK )
#pragma ident "@(#)int_limits.h 1.9 04/09/28 SMI"
#define INT_FAST16_MAX INT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define INT_FAST16_MIN INT32_MIN
#endif /* SOLARIS_INT_LIMITS_2_CHECK */


#if defined( SOLARIS_INT_LIMITS_3_CHECK )
#define SIZE_MAX 4294967295U
#endif /* SOLARIS_INT_LIMITS_3_CHECK */

0 comments on commit d462c2e

Please sign in to comment.