summaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-15 21:13:30 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-15 21:13:30 +0000
commit39bbddbe92497da1434a6094baf524933112d952 (patch)
tree01395f40417e495e78dfa4d7f1014c4e9a07ceb8 /fixincludes
parent2f85f48df0fa7be4b0ec364ba585bfed5ca0691c (diff)
downloadgcc-39bbddbe92497da1434a6094baf524933112d952.tar.gz
Merged revisions
148298-148299,148302,148306,148309,148311,148313-148319,148321-148322,148324-148325,148328,148332-148333,148336-148337,148339-148349,148352,148355-148358,148361,148364-148367,148390,148392-148396,148402-148404,148407-148415,148428,148431,148433-148434,148437-148438,148440-148444,148448-148449,148451-148453,148456,148458-148463,148466,148471-148472,148480,148483,148485-148487,148491-148494,148497-148499,148503 via svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@148507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/ChangeLog7
-rw-r--r--fixincludes/fixincl.x212
-rw-r--r--fixincludes/inclhack.def102
-rw-r--r--fixincludes/tests/base/stdint.h35
4 files changed, 351 insertions, 5 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index c7305c05136..9bdd28d3641 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * inclhack.def (darwin_stdint_1, darwin_stdint_2, darwin_stdint_3,
+ darwin_stdint_4): New fixes.
+ * tests/base/stdint.h: Adjust test results for new fixes.
+ * fixincl.x: Regenerate.
+
2009-05-29 Eric Botcazou <ebotcazou@adacore.com>
* inclhack.def (solaris_int_const): New fix.
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index cb8fc889a27..433740f3028 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 Saturday May 30, 2009 at 12:11:05 AM CEST
+ * It has been AutoGen-ed Monday June 8, 2009 at 08:37:38 PM CEST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sat May 30 00:11:05 CEST 2009
+/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Jun 8 20:37:38 CEST 2009
*
* 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 191 fixup descriptions.
+ * This file contains 195 fixup descriptions.
*
* See README for more information.
*
@@ -1787,6 +1787,184 @@ static const char* apzDarwin_Private_ExternPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_Stdint_1 fix
+ */
+tSCC zDarwin_Stdint_1Name[] =
+ "darwin_stdint_1";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_1List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_1Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_1Select0[] =
+ "#define UINT8_C\\(v\\)[ \t]+\\(v ## U\\)\n\
+#define UINT16_C\\(v\\)[ \t]+\\(v ## U\\)";
+
+#define DARWIN_STDINT_1_TEST_CT 1
+static tTestDesc aDarwin_Stdint_1Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_1Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_1
+ */
+static const char* apzDarwin_Stdint_1Patch[] = {
+ "format",
+ "#define UINT8_C(v)\tv\n\
+#define UINT16_C(v)\tv",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_2 fix
+ */
+tSCC zDarwin_Stdint_2Name[] =
+ "darwin_stdint_2";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_2List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_2Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_2Select0[] =
+ "#if __WORDSIZE == 64\n\
+#define INTPTR_MIN[ \t]+INT64_MIN\n\
+#define INTPTR_MAX[ \t]+INT64_MAX\n\
+#else\n\
+#define INTPTR_MIN[ \t]+INT32_MIN\n\
+#define INTPTR_MAX[ \t]+INT32_MAX\n\
+#endif";
+
+#define DARWIN_STDINT_2_TEST_CT 1
+static tTestDesc aDarwin_Stdint_2Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_2Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_2
+ */
+static const char* apzDarwin_Stdint_2Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define INTPTR_MAX 9223372036854775807L\n\
+#define INTPTR_MIN (-INTPTR_MAX-1)\n\
+#else\n\
+#define INTPTR_MAX 2147483647L\n\
+#define INTPTR_MIN (-INTPTR_MAX-1)\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_3 fix
+ */
+tSCC zDarwin_Stdint_3Name[] =
+ "darwin_stdint_3";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_3List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_3Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_3Select0[] =
+ "#if __WORDSIZE == 64\n\
+#define UINTPTR_MAX[ \t]+UINT64_MAX\n\
+#else\n\
+#define UINTPTR_MAX[ \t]+UINT32_MAX\n\
+#endif";
+
+#define DARWIN_STDINT_3_TEST_CT 1
+static tTestDesc aDarwin_Stdint_3Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_3Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_3
+ */
+static const char* apzDarwin_Stdint_3Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define UINTPTR_MAX 18446744073709551615UL\n\
+#else\n\
+#define UINTPTR_MAX 4294967295UL\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_4 fix
+ */
+tSCC zDarwin_Stdint_4Name[] =
+ "darwin_stdint_4";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_4List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_4Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_4Select0[] =
+ "#if __WORDSIZE == 64\n\
+#define SIZE_MAX[ \t]+UINT64_MAX\n\
+#else\n\
+#define SIZE_MAX[ \t]+UINT32_MAX\n\
+#endif";
+
+#define DARWIN_STDINT_4_TEST_CT 1
+static tTestDesc aDarwin_Stdint_4Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_4Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_4
+ */
+static const char* apzDarwin_Stdint_4Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define SIZE_MAX 18446744073709551615UL\n\
+#else\n\
+#define SIZE_MAX 4294967295UL\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Dec_Intern_Asm fix
*/
tSCC zDec_Intern_AsmName[] =
@@ -7733,9 +7911,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 233
+#define REGEX_COUNT 237
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 191
+#define FIX_COUNT 195
/*
* Enumerate the fixes
@@ -7783,6 +7961,10 @@ typedef enum {
DARWIN_EXTERNC_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
DARWIN_PRIVATE_EXTERN_FIXIDX,
+ DARWIN_STDINT_1_FIXIDX,
+ DARWIN_STDINT_2_FIXIDX,
+ DARWIN_STDINT_3_FIXIDX,
+ DARWIN_STDINT_4_FIXIDX,
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
@@ -8145,6 +8327,26 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Private_ExternTests, apzDarwin_Private_ExternPatch, 0 },
+ { zDarwin_Stdint_1Name, zDarwin_Stdint_1List,
+ apzDarwin_Stdint_1Machs,
+ DARWIN_STDINT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_1Tests, apzDarwin_Stdint_1Patch, 0 },
+
+ { zDarwin_Stdint_2Name, zDarwin_Stdint_2List,
+ apzDarwin_Stdint_2Machs,
+ DARWIN_STDINT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_2Tests, apzDarwin_Stdint_2Patch, 0 },
+
+ { zDarwin_Stdint_3Name, zDarwin_Stdint_3List,
+ apzDarwin_Stdint_3Machs,
+ DARWIN_STDINT_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_3Tests, apzDarwin_Stdint_3Patch, 0 },
+
+ { zDarwin_Stdint_4Name, zDarwin_Stdint_4List,
+ apzDarwin_Stdint_4Machs,
+ DARWIN_STDINT_4_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_4Tests, apzDarwin_Stdint_4Patch, 0 },
+
{ zDec_Intern_AsmName, zDec_Intern_AsmList,
apzDec_Intern_AsmMachs,
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index cfa567f29c9..f9845cc74f5 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1023,6 +1023,108 @@ fix = {
/*
+ * Darwin headers have a stdint.h that defines UINT8_C and UINT16_C to
+ * unsigned constants.
+ */
+fix = {
+ hackname = darwin_stdint_1;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#define UINT8_C(v)\tv\n#define UINT16_C(v)\tv";
+ select = "#define UINT8_C\\(v\\)[ \t]+\\(v ## U\\)\n"
+ "#define UINT16_C\\(v\\)[ \t]+\\(v ## U\\)";
+ test_text = "#define UINT8_C(v) (v ## U)\n"
+ "#define UINT16_C(v) (v ## U)";
+};
+
+
+/*
+ * Darwin headers have a stdint.h that defines INTPTR_MIN and INTPTR_MAX
+ * with wrong types.
+ */
+fix = {
+ hackname = darwin_stdint_2;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define INTPTR_MAX 9223372036854775807L\n"
+ "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
+ "#else\n"
+ "#define INTPTR_MAX 2147483647L\n"
+ "#define INTPTR_MIN (-INTPTR_MAX-1)\n"
+ "#endif";
+ select = "#if __WORDSIZE == 64\n"
+ "#define INTPTR_MIN[ \t]+INT64_MIN\n"
+ "#define INTPTR_MAX[ \t]+INT64_MAX\n"
+ "#else\n"
+ "#define INTPTR_MIN[ \t]+INT32_MIN\n"
+ "#define INTPTR_MAX[ \t]+INT32_MAX\n"
+ "#endif";
+ test_text = "#if __WORDSIZE == 64\n"
+ "#define INTPTR_MIN INT64_MIN\n"
+ "#define INTPTR_MAX INT64_MAX\n"
+ "#else\n"
+ "#define INTPTR_MIN INT32_MIN\n"
+ "#define INTPTR_MAX INT32_MAX\n"
+ "#endif";
+};
+
+
+/*
+ * Darwin headers have a stdint.h that defines UINTPTR_MAX with a wrong type.
+ */
+fix = {
+ hackname = darwin_stdint_3;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define UINTPTR_MAX 18446744073709551615UL\n"
+ "#else\n"
+ "#define UINTPTR_MAX 4294967295UL\n"
+ "#endif";
+ select = "#if __WORDSIZE == 64\n"
+ "#define UINTPTR_MAX[ \t]+UINT64_MAX\n"
+ "#else\n"
+ "#define UINTPTR_MAX[ \t]+UINT32_MAX\n"
+ "#endif";
+ test_text = "#if __WORDSIZE == 64\n"
+ "#define UINTPTR_MAX UINT64_MAX\n"
+ "#else\n"
+ "#define UINTPTR_MAX UINT32_MAX\n"
+ "#endif";
+};
+
+
+/*
+ * Darwin headers have a stdint.h that defines SIZE_MAX with a wrong type.
+ */
+fix = {
+ hackname = darwin_stdint_4;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define SIZE_MAX 18446744073709551615UL\n"
+ "#else\n"
+ "#define SIZE_MAX 4294967295UL\n"
+ "#endif";
+ select = "#if __WORDSIZE == 64\n"
+ "#define SIZE_MAX[ \t]+UINT64_MAX\n"
+ "#else\n"
+ "#define SIZE_MAX[ \t]+UINT32_MAX\n"
+ "#endif";
+ test_text = "#if __WORDSIZE == 64\n"
+ "#define SIZE_MAX UINT64_MAX\n"
+ "#else\n"
+ "#define SIZE_MAX UINT32_MAX\n"
+ "#endif";
+};
+
+
+/*
* Fix <c_asm.h> on Digital UNIX V4.0:
* It contains a prototype for a DEC C internal asm() function,
* clashing with gcc's asm keyword. So protect this with __DECC.
diff --git a/fixincludes/tests/base/stdint.h b/fixincludes/tests/base/stdint.h
index 653c5da69e8..35039db4f2b 100644
--- a/fixincludes/tests/base/stdint.h
+++ b/fixincludes/tests/base/stdint.h
@@ -9,6 +9,41 @@
+#if defined( DARWIN_STDINT_1_CHECK )
+#define UINT8_C(c) __UINT8_C(c)
+#define UINT16_C(c) __UINT16_C(c)
+#endif /* DARWIN_STDINT_1_CHECK */
+
+
+#if defined( DARWIN_STDINT_2_CHECK )
+#if __WORDSIZE == 64
+#define INTPTR_MAX 9223372036854775807L
+#define INTPTR_MIN (-INTPTR_MAX-1)
+#else
+#define INTPTR_MAX 2147483647L
+#define INTPTR_MIN (-INTPTR_MAX-1)
+#endif
+#endif /* DARWIN_STDINT_2_CHECK */
+
+
+#if defined( DARWIN_STDINT_3_CHECK )
+#if __WORDSIZE == 64
+#define UINTPTR_MAX 18446744073709551615UL
+#else
+#define UINTPTR_MAX 4294967295UL
+#endif
+#endif /* DARWIN_STDINT_3_CHECK */
+
+
+#if defined( DARWIN_STDINT_4_CHECK )
+#if __WORDSIZE == 64
+#define SIZE_MAX __SIZE_MAX__
+#else
+#define SIZE_MAX __SIZE_MAX__
+#endif
+#endif /* DARWIN_STDINT_4_CHECK */
+
+
#if defined( GLIBC_STDINT_CHECK )
/* This file is part of the GNU C Library. */
# define UINT8_C(c) c