summaryrefslogtreecommitdiff
path: root/fixincludes
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-06 13:17:06 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-06 13:17:06 +0000
commit903a187914a19de9b6e5f34603c6f0553251a338 (patch)
tree6ba1a49474b7c3ae0e9ca2188aef521596b817da /fixincludes
parent506ce9fced0523910f9a486e75b3a4edfd5fea4f (diff)
downloadgcc-903a187914a19de9b6e5f34603c6f0553251a338.tar.gz
* SVN merge from the trunk
* Deleted no longer needed libgfortran/ChangeLog.dev Merged revisions 148767-148770,148774-148777,148779-148796,148798-148801,148804,148806, 148808-148811,148813-148817,148821,148823,148825-148828,148831, 148833-148852,148857,148861-148862,148868-148870,148872,148877,148880, 148883,148885,148888-148890,148892-148893,148895-148906,148909-148910, 148913-148917,148919,148925-148938,148941-148942,148946-148953,148955, 148958-148959,148961-148968,148971,148975-148984,148986-148987,148996, 148999,149002,149004-149014,149017-149018,149022-149023,149031-149038, 149043,149046-149048,149054,149057,149059-149060,149062-149070, 149073-149076,149078-149080,149082-149090,149093-149094,149098, 149100-149103,149108-149109,149112-149115,149117,149119-149121, 149126,149128,149135-149138,149140-149141,149144-149155,149157-149158, 149162-149167,149169-149171,149176,149178-149179,149182,149188,149190, 149195,149199,149204-149207,149209-149212,149216-149217,149222-149228, 149234-149236,149238-149239,149241-149243,149246-149247,149260,149262, 149268,149276-149277,149279 via svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@149280 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/ChangeLog13
-rw-r--r--fixincludes/fixincl.x216
-rw-r--r--fixincludes/inclhack.def109
-rw-r--r--fixincludes/tests/base/stdint.h35
-rw-r--r--fixincludes/tests/base/sys/int_types.h20
5 files changed, 387 insertions, 6 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 9bdd28d3641..35260caca66 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,16 @@
+2009-07-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * inclhack.def (darwin_stdint_5, darwin_stdint_6,
+ darwin_stdint_7): New fixes.
+ * fixincl.x: Regenerate.
+ * tests/base/stdint.h: Adjust test for new fixes.
+
+2009-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * inclhack.def (solaris_int_types): New fix.
+ * fixincl.x: Regenerate.
+ * tests/base/sys/int_types.h: New file.
+
2009-06-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* inclhack.def (darwin_stdint_1, darwin_stdint_2, darwin_stdint_3,
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 433740f3028..90eb9370aef 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 Monday June 8, 2009 at 08:37:38 PM CEST
+ * It has been AutoGen-ed Saturday July 4, 2009 at 10:06:21 AM CEST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Jun 8 20:37:38 CEST 2009
+/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Jul 4 10:06:21 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 195 fixup descriptions.
+ * This file contains 199 fixup descriptions.
*
* See README for more information.
*
@@ -1965,6 +1965,146 @@ static const char* apzDarwin_Stdint_4Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_Stdint_5 fix
+ */
+tSCC zDarwin_Stdint_5Name[] =
+ "darwin_stdint_5";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_5List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_5Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_5Select0[] =
+ "#define INTMAX_MIN[ \t]+INT64_MIN\n\
+#define INTMAX_MAX[ \t]+INT64_MAX\n\n\
+#define UINTMAX_MAX[ \t]+UINT64_MAX";
+
+#define DARWIN_STDINT_5_TEST_CT 1
+static tTestDesc aDarwin_Stdint_5Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_5Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_5
+ */
+static const char* apzDarwin_Stdint_5Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define INTMAX_MIN (-9223372036854775807L - 1)\n\
+#define INTMAX_MAX 9223372036854775807L\n\
+#define UINTMAX_MAX 18446744073709551615UL\n\
+#else\n\
+#define INTMAX_MIN (-9223372036854775807LL - 1)\n\
+#define INTMAX_MAX 9223372036854775807LL\n\
+#define UINTMAX_MAX 18446744073709551615ULL\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_6 fix
+ */
+tSCC zDarwin_Stdint_6Name[] =
+ "darwin_stdint_6";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_6List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_6Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_6Select0[] =
+ "#if __WORDSIZE == 64\n\
+#define PTRDIFF_MIN[ \t]+INT64_MIN\n\
+#define PTRDIFF_MAX[ \t]+INT64_MAX\n\
+#else\n\
+#define PTRDIFF_MIN[ \t]+INT32_MIN\n\
+#define PTRDIFF_MAX[ \t]+INT32_MAX\n\
+#endif";
+
+#define DARWIN_STDINT_6_TEST_CT 1
+static tTestDesc aDarwin_Stdint_6Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_6Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_6
+ */
+static const char* apzDarwin_Stdint_6Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define PTRDIFF_MIN (-9223372036854775807L - 1)\n\
+#define PTRDIFF_MAX 9223372036854775807L\n\
+#else\n\
+#define PTRDIFF_MIN (-2147483647 - 1)\n\
+#define PTRDIFF_MAX 2147483647\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_7 fix
+ */
+tSCC zDarwin_Stdint_7Name[] =
+ "darwin_stdint_7";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_7List[] =
+ "stdint.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_7Machs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Stdint_7Select0[] =
+ "#define INTMAX_C\\(v\\)[ \t]+\\(v ## LL\\)\n\
+#define UINTMAX_C\\(v\\)[ \t]+\\(v ## ULL\\)";
+
+#define DARWIN_STDINT_7_TEST_CT 1
+static tTestDesc aDarwin_Stdint_7Tests[] = {
+ { TT_EGREP, zDarwin_Stdint_7Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_7
+ */
+static const char* apzDarwin_Stdint_7Patch[] = {
+ "format",
+ "#if __WORDSIZE == 64\n\
+#define INTMAX_C(v) (v ## L)\n\
+#define UINTMAX_C(v) (v ## UL)\n\
+#else\n\
+#define INTMAX_C(v) (v ## LL)\n\
+#define UINTMAX_C(v) (v ## ULL)\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Dec_Intern_Asm fix
*/
tSCC zDec_Intern_AsmName[] =
@@ -6373,6 +6513,48 @@ static const char* apzSolaris_Int_Limits_2Patch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Int_Types fix
+ */
+tSCC zSolaris_Int_TypesName[] =
+ "solaris_int_types";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Int_TypesList[] =
+ "sys/int_types.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzSolaris_Int_TypesMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Int_TypesSelect0[] =
+ "__STDC__ - 0 == 0";
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zSolaris_Int_TypesBypass0[] =
+ "_LONGLONG_TYPE";
+
+#define SOLARIS_INT_TYPES_TEST_CT 2
+static tTestDesc aSolaris_Int_TypesTests[] = {
+ { TT_NEGREP, zSolaris_Int_TypesBypass0, (regex_t*)NULL },
+ { TT_EGREP, zSolaris_Int_TypesSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Int_Types
+ */
+static const char* apzSolaris_Int_TypesPatch[] = {
+ "format",
+ "(defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__))",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Stdio_Tag fix
*/
tSCC zSolaris_Stdio_TagName[] =
@@ -7911,9 +8093,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 237
+#define REGEX_COUNT 242
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 195
+#define FIX_COUNT 199
/*
* Enumerate the fixes
@@ -7965,6 +8147,9 @@ typedef enum {
DARWIN_STDINT_2_FIXIDX,
DARWIN_STDINT_3_FIXIDX,
DARWIN_STDINT_4_FIXIDX,
+ DARWIN_STDINT_5_FIXIDX,
+ DARWIN_STDINT_6_FIXIDX,
+ DARWIN_STDINT_7_FIXIDX,
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
@@ -8076,6 +8261,7 @@ typedef enum {
SOLARIS_INT_CONST_FIXIDX,
SOLARIS_INT_LIMITS_1_FIXIDX,
SOLARIS_INT_LIMITS_2_FIXIDX,
+ SOLARIS_INT_TYPES_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
STATSSWTCH_FIXIDX,
STDIO_STDARG_H_FIXIDX,
@@ -8347,6 +8533,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_STDINT_4_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Stdint_4Tests, apzDarwin_Stdint_4Patch, 0 },
+ { zDarwin_Stdint_5Name, zDarwin_Stdint_5List,
+ apzDarwin_Stdint_5Machs,
+ DARWIN_STDINT_5_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_5Tests, apzDarwin_Stdint_5Patch, 0 },
+
+ { zDarwin_Stdint_6Name, zDarwin_Stdint_6List,
+ apzDarwin_Stdint_6Machs,
+ DARWIN_STDINT_6_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_6Tests, apzDarwin_Stdint_6Patch, 0 },
+
+ { zDarwin_Stdint_7Name, zDarwin_Stdint_7List,
+ apzDarwin_Stdint_7Machs,
+ DARWIN_STDINT_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_7Tests, apzDarwin_Stdint_7Patch, 0 },
+
{ zDec_Intern_AsmName, zDec_Intern_AsmList,
apzDec_Intern_AsmMachs,
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
@@ -8902,6 +9103,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_TypesName, zSolaris_Int_TypesList,
+ apzSolaris_Int_TypesMachs,
+ SOLARIS_INT_TYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Int_TypesTests, apzSolaris_Int_TypesPatch, 0 },
+
{ zSolaris_Stdio_TagName, zSolaris_Stdio_TagList,
apzSolaris_Stdio_TagMachs,
SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index f9845cc74f5..8cb6b7ed61d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -1125,6 +1125,91 @@ fix = {
/*
+ * Darwin headers have a stdint.h that defines {U,}INTMAX_{MIN,MAX}
+ * with a wrong type.
+ */
+fix = {
+ hackname = darwin_stdint_5;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define INTMAX_MIN (-9223372036854775807L - 1)\n"
+ "#define INTMAX_MAX 9223372036854775807L\n"
+ "#define UINTMAX_MAX 18446744073709551615UL\n"
+ "#else\n"
+ "#define INTMAX_MIN (-9223372036854775807LL - 1)\n"
+ "#define INTMAX_MAX 9223372036854775807LL\n"
+ "#define UINTMAX_MAX 18446744073709551615ULL\n"
+ "#endif";
+ select = "#define INTMAX_MIN[ \t]+INT64_MIN\n"
+ "#define INTMAX_MAX[ \t]+INT64_MAX\n"
+ "\n"
+ "#define UINTMAX_MAX[ \t]+UINT64_MAX";
+ test_text = "#define INTMAX_MIN INT64_MIN\n"
+ "#define INTMAX_MAX INT64_MAX\n"
+ "\n"
+ "#define UINTMAX_MAX UINT64_MAX";
+};
+
+
+/*
+ * Darwin headers have a stdint.h that defines {U,}INTMAX_C
+ * with a wrong type.
+ */
+fix = {
+ hackname = darwin_stdint_6;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define PTRDIFF_MIN (-9223372036854775807L - 1)\n"
+ "#define PTRDIFF_MAX 9223372036854775807L\n"
+ "#else\n"
+ "#define PTRDIFF_MIN (-2147483647 - 1)\n"
+ "#define PTRDIFF_MAX 2147483647\n"
+ "#endif";
+ select = "#if __WORDSIZE == 64\n"
+ "#define PTRDIFF_MIN[ \t]+INT64_MIN\n"
+ "#define PTRDIFF_MAX[ \t]+INT64_MAX\n"
+ "#else\n"
+ "#define PTRDIFF_MIN[ \t]+INT32_MIN\n"
+ "#define PTRDIFF_MAX[ \t]+INT32_MAX\n"
+ "#endif";
+ test_text = "#if __WORDSIZE == 64\n"
+ "#define PTRDIFF_MIN INT64_MIN\n"
+ "#define PTRDIFF_MAX INT64_MAX\n"
+ "#else\n"
+ "#define PTRDIFF_MIN INT32_MIN\n"
+ "#define PTRDIFF_MAX INT32_MAX\n"
+ "#endif";
+};
+
+
+/*
+ * Darwin headers have a stdint.h that defines {U,}INTMAX_C
+ * with a wrong type.
+ */
+fix = {
+ hackname = darwin_stdint_7;
+ mach = "*-*-darwin*";
+ files = stdint.h;
+ c_fix = format;
+ c_fix_arg = "#if __WORDSIZE == 64\n"
+ "#define INTMAX_C(v) (v ## L)\n"
+ "#define UINTMAX_C(v) (v ## UL)\n"
+ "#else\n"
+ "#define INTMAX_C(v) (v ## LL)\n"
+ "#define UINTMAX_C(v) (v ## ULL)\n"
+ "#endif";
+ select = "#define INTMAX_C\\(v\\)[ \t]+\\(v ## LL\\)\n"
+ "#define UINTMAX_C\\(v\\)[ \t]+\\(v ## ULL\\)";
+ test_text = "#define INTMAX_C(v) (v ## LL)\n"
+ "#define UINTMAX_C(v) (v ## ULL)";
+};
+
+
+/*
* 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.
@@ -3331,7 +3416,29 @@ fix = {
/*
- * Solaris 2.8 has what appears to be some gross workaround for
+ * 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.
+ */
+fix = {
+ hackname = solaris_int_types;
+ select = "__STDC__ - 0 == 0";
+ bypass = "_LONGLONG_TYPE";
+ files = sys/int_types.h;
+ c_fix = format;
+ c_fix_arg =
+ "(defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__))";
+ test_text =
+ "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
+ "typedef long long int64_t;\n"
+ "#endif\n\n"
+ "#if defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG))\n"
+ "typedef int64_t intmax_t;\n"
+ "#endif";
+};
+
+
+/*
+ * Sun Solaris 8 has what appears to be some gross workaround for
* some old version of their c++ compiler. G++ doesn't want it
* either, but doesn't want to be tied to SunPRO version numbers.
*/
diff --git a/fixincludes/tests/base/stdint.h b/fixincludes/tests/base/stdint.h
index 35039db4f2b..77e77fae079 100644
--- a/fixincludes/tests/base/stdint.h
+++ b/fixincludes/tests/base/stdint.h
@@ -44,6 +44,41 @@
#endif /* DARWIN_STDINT_4_CHECK */
+#if defined( DARWIN_STDINT_5_CHECK )
+#if __WORDSIZE == 64
+#define INTMAX_MIN (-9223372036854775807L - 1)
+#define INTMAX_MAX 9223372036854775807L
+#define UINTMAX_MAX 18446744073709551615UL
+#else
+#define INTMAX_MIN (-9223372036854775807LL - 1)
+#define INTMAX_MAX 9223372036854775807LL
+#define UINTMAX_MAX 18446744073709551615ULL
+#endif
+#endif /* DARWIN_STDINT_5_CHECK */
+
+
+#if defined( DARWIN_STDINT_6_CHECK )
+#if __WORDSIZE == 64
+#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
+#define PTRDIFF_MAX __PTRDIFF_MAX__
+#else
+#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
+#define PTRDIFF_MAX __PTRDIFF_MAX__
+#endif
+#endif /* DARWIN_STDINT_6_CHECK */
+
+
+#if defined( DARWIN_STDINT_7_CHECK )
+#if __WORDSIZE == 64
+#define INTMAX_C(v) (v ## L)
+#define UINTMAX_C(v) (v ## UL)
+#else
+#define INTMAX_C(v) (v ## LL)
+#define UINTMAX_C(v) (v ## ULL)
+#endif
+#endif /* DARWIN_STDINT_7_CHECK */
+
+
#if defined( GLIBC_STDINT_CHECK )
/* This file is part of the GNU C Library. */
# define UINT8_C(c) c
diff --git a/fixincludes/tests/base/sys/int_types.h b/fixincludes/tests/base/sys/int_types.h
new file mode 100644
index 00000000000..39bb68acd78
--- /dev/null
+++ b/fixincludes/tests/base/sys/int_types.h
@@ -0,0 +1,20 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/sys/int_types.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( SOLARIS_INT_TYPES_CHECK )
+#if (defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__)) && !defined(_NO_LONGLONG)
+typedef long long int64_t;
+#endif
+
+#if defined(_LP64) || ((defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__)) && !defined(_NO_LONGLONG))
+typedef int64_t intmax_t;
+#endif
+#endif /* SOLARIS_INT_TYPES_CHECK */