aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/fixinc/fixincl.x113
-rw-r--r--gcc/fixinc/inclhack.def61
-rw-r--r--gcc/fixinc/tests/base/dirent.h (renamed from gcc/fixinc/tests/base/libgen.h)2
-rw-r--r--gcc/fixinc/tests/base/pthread.h3
-rw-r--r--gcc/fixinc/tests/base/standards.h14
-rw-r--r--gcc/fixinc/tests/base/sys/stat.h4
-rw-r--r--gcc/fixinc/tests/base/testing.h10
8 files changed, 215 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 798474f..dc08858 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,31 @@
+2004-01-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (alpha___extern_prefix): Renamed to ...
+ (alpha___extern_prefix_sys_stat): ... this.
+ Apply to <sys/mount.h>, too.
+ Tweak to match more variations.
+ * fixinc/tests/base/sys/stat.h: Adapt for new hackname.
+
+ * fixinc/inclhack.def (alpha___extern_prefix,
+ alpha___extern_prefix_standards): New hacks to obey
+ __PRAGMA_EXTERN_PREFIX.
+ * fixinc/tests/base/testing.h [ALPHA___EXTERN_PREFIX_CHECK]: New
+ test.
+ * fixinc/tests/base/standards.h: Likewise.
+
+ * fixincl/inclhack.def (alpha_pthread): Tweak to match more
+ variations.
+ New testcase.
+ * fixinc/tests/base/pthread.h: Handle it.
+
+ * fixincl/inclhack.def (bad_lval): Sort file list.
+ Add many missing files up to Tru64 UNIX V5.1B.
+ * gcc/fixinc/tests/base/libgen.h: Renamed to ...
+ * gcc/fixinc/tests/base/dirent.h: ... this to match new file list
+ order.
+
+ * fixinc/fixincl.x: Regenerate.
+
2004-01-16 Mark Mitchell <mark@codesourcery.com>
* version.c (version_string): Change to 3.5.0.
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index 1609605..94caee7 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Thursday December 18, 2003 at 01:49:23 PM PST
+ * It has been AutoGen-ed Tuesday December 23, 2003 at 01:59:31 PM MET
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Dec 18 13:49:23 PST 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Tue Dec 23 13:59:32 MET 2003
*
* 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 163 fixup descriptions.
+ * This file contains 165 fixup descriptions.
*
* See README for more information.
*
@@ -727,20 +727,20 @@ tSCC zAlpha___Extern_PrefixName[] =
/*
* File name selection pattern
*/
-tSCC zAlpha___Extern_PrefixList[] =
- "|sys/stat.h|";
+#define zAlpha___Extern_PrefixList (char*)NULL
/*
* Machine/OS name selection pattern
*/
tSCC* apzAlpha___Extern_PrefixMachs[] = {
- "alpha*-dec-osf5*",
+ "alpha*-dec-osf*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zAlpha___Extern_PrefixSelect0[] =
- "#[ \t]*if[ \t]*defined\\(__DECC\\)";
+ "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n\
+(#[ \t]*pragma[ \t]*extern_prefix.*)";
#define ALPHA___EXTERN_PREFIX_TEST_CT 1
static tTestDesc aAlpha___Extern_PrefixTests[] = {
@@ -751,6 +751,81 @@ static tTestDesc aAlpha___Extern_PrefixTests[] = {
*/
static const char* apzAlpha___Extern_PrefixPatch[] = {
"format",
+ "%1 (defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX))\n\
+%3",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Alpha___Extern_Prefix_Standards fix
+ */
+tSCC zAlpha___Extern_Prefix_StandardsName[] =
+ "alpha___extern_prefix_standards";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAlpha___Extern_Prefix_StandardsList[] =
+ "|standards.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAlpha___Extern_Prefix_StandardsMachs[] = {
+ "alpha*-dec-osf*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha___Extern_Prefix_StandardsSelect0[] =
+ ".*!defined\\(_LIBC_POLLUTION_H_\\) && !defined\\(__DECC\\)";
+
+#define ALPHA___EXTERN_PREFIX_STANDARDS_TEST_CT 1
+static tTestDesc aAlpha___Extern_Prefix_StandardsTests[] = {
+ { TT_EGREP, zAlpha___Extern_Prefix_StandardsSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Alpha___Extern_Prefix_Standards
+ */
+static const char* apzAlpha___Extern_Prefix_StandardsPatch[] = {
+ "format",
+ "%0 && !defined(__PRAGMA_EXTERN_PREFIX)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Alpha___Extern_Prefix_Sys_Stat fix
+ */
+tSCC zAlpha___Extern_Prefix_Sys_StatName[] =
+ "alpha___extern_prefix_sys_stat";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAlpha___Extern_Prefix_Sys_StatList[] =
+ "|sys/stat.h|sys/mount.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAlpha___Extern_Prefix_Sys_StatMachs[] = {
+ "alpha*-dec-osf5*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha___Extern_Prefix_Sys_StatSelect0[] =
+ "#[ \t]*if[ \t]*defined\\(__DECC\\)";
+
+#define ALPHA___EXTERN_PREFIX_SYS_STAT_TEST_CT 1
+static tTestDesc aAlpha___Extern_Prefix_Sys_StatTests[] = {
+ { TT_EGREP, zAlpha___Extern_Prefix_Sys_StatSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Alpha___Extern_Prefix_Sys_Stat
+ */
+static const char* apzAlpha___Extern_Prefix_Sys_StatPatch[] = {
+ "format",
"%0 || defined(__PRAGMA_EXTERN_PREFIX)",
(char*)NULL };
@@ -882,7 +957,7 @@ tSCC* apzAlpha_PthreadMachs[] = {
* content selection pattern - do fix if pattern found
*/
tSCC zAlpha_PthreadSelect0[] =
- "(#[ \t]*if defined \\(_PTHREAD_ENV_DECC\\) || defined \\(_PTHREAD_ENV_EPCC\\))\n\
+ "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)|def _PTHREAD_ENV_DECC)(.*))\n\
(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
#define ALPHA_PTHREAD_TEST_CT 1
@@ -894,8 +969,8 @@ static tTestDesc aAlpha_PthreadTests[] = {
*/
static const char* apzAlpha_PthreadPatch[] = {
"format",
- "%1 || defined (__PRAGMA_EXTERN_PREFIX)\n\
-%2",
+ "%2 defined (_PTHREAD_ENV_DECC)%4 || defined (__PRAGMA_EXTERN_PREFIX)\n\
+%5",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -1159,7 +1234,7 @@ tSCC zBad_LvalName[] =
* File name selection pattern
*/
tSCC zBad_LvalList[] =
- "|libgen.h|dirent.h|ftw.h|grp.h|ndbm.h|pthread.h|pwd.h|signal.h|standards.h|stdlib.h|string.h|stropts.h|time.h|unistd.h|";
+ "|dirent.h|ftw.h|grp.h|libgen.h|ndbm.h|pthread.h|pwd.h|signal.h|standards.h|stdio.h|stdlib.h|string.h|stropts.h|sys/mount.h|sys/resource.h|sys/signal.h|sys/socket.h|sys/stat.h|sys/stropts.h|sys/uio.h|time.h|unistd.h|utmp.h|utmpx.h|wchar.h|";
/*
* Machine/OS name selection pattern
*/
@@ -6453,9 +6528,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 183
+#define REGEX_COUNT 185
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 163
+#define FIX_COUNT 165
/*
* Enumerate the fixes
@@ -6476,6 +6551,8 @@ typedef enum {
AIX_VOLATILE_FIXIDX,
ALPHA___ASSERT_FIXIDX,
ALPHA___EXTERN_PREFIX_FIXIDX,
+ ALPHA___EXTERN_PREFIX_STANDARDS_FIXIDX,
+ ALPHA___EXTERN_PREFIX_SYS_STAT_FIXIDX,
ALPHA_ASSERT_FIXIDX,
ALPHA_GETOPT_FIXIDX,
ALPHA_PARENS_FIXIDX,
@@ -6702,6 +6779,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ALPHA___EXTERN_PREFIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAlpha___Extern_PrefixTests, apzAlpha___Extern_PrefixPatch, 0 },
+ { zAlpha___Extern_Prefix_StandardsName, zAlpha___Extern_Prefix_StandardsList,
+ apzAlpha___Extern_Prefix_StandardsMachs,
+ ALPHA___EXTERN_PREFIX_STANDARDS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aAlpha___Extern_Prefix_StandardsTests, apzAlpha___Extern_Prefix_StandardsPatch, 0 },
+
+ { zAlpha___Extern_Prefix_Sys_StatName, zAlpha___Extern_Prefix_Sys_StatList,
+ apzAlpha___Extern_Prefix_Sys_StatMachs,
+ ALPHA___EXTERN_PREFIX_SYS_STAT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aAlpha___Extern_Prefix_Sys_StatTests, apzAlpha___Extern_Prefix_Sys_StatPatch, 0 },
+
{ zAlpha_AssertName, zAlpha_AssertList,
apzAlpha_AssertMachs,
ALPHA_ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 95a5534..68fbaf5 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -523,11 +523,50 @@ fix = {
/*
- * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V5 <sys/stat.h>.
+ * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V4/5 headers.
*/
fix = {
hackname = alpha___extern_prefix;
+ select = "(.*)(defined\\(__DECC\\)|def[ \t]*__DECC)[ \t]*\n(#[ \t]*pragma[ \t]*extern_prefix.*)";
+
+ mach = "alpha*-dec-osf*";
+ c_fix = format;
+ c_fix_arg = "%1 (defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX))\n%3";
+
+ test_text = "#ifdef __DECC\n"
+ "#pragma extern_prefix \"_P\"\n"
+ "# if defined(__DECC)\n"
+ "# pragma extern_prefix \"_E\"\n"
+ "# if !defined(_LIBC_POLLUTION_H_) && defined(__DECC)\n"
+ "# pragma extern_prefix \"\"";
+};
+
+
+/*
+ * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V4/5 <standards.h>.
+ */
+fix = {
+ hackname = alpha___extern_prefix_standards;
+ files = standards.h;
+ select = ".*!defined\\(_LIBC_POLLUTION_H_\\) && !defined\\(__DECC\\)";
+
+ mach = "alpha*-dec-osf*";
+ c_fix = format;
+ c_fix_arg = "%0 && !defined(__PRAGMA_EXTERN_PREFIX)";
+
+ test_text = "#if (_ISO_C_SOURCE>=19990L) && !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)";
+};
+
+
+/*
+ * Obey __PRAGMA_EXTERN_PREFIX for Tru64 UNIX V5 <sys/mount.h> and
+ * <sys/stat.h>. The tests for __DECC are special in various ways, so
+ * alpha__extern_prefix cannot be used.
+ */
+fix = {
+ hackname = alpha___extern_prefix_sys_stat;
files = sys/stat.h;
+ files = sys/mount.h;
select = "#[ \t]*if[ \t]*defined\\(__DECC\\)";
mach = "alpha*-dec-osf5*";
@@ -585,15 +624,18 @@ fix = {
fix = {
hackname = alpha_pthread;
files = pthread.h;
- select = "(#[ \t]*if defined \\(_PTHREAD_ENV_DECC\\) || defined \\(_PTHREAD_ENV_EPCC\\))\n"
+ select = "((#[ \t]*if)([ \t]*defined[ \t]*\\(_PTHREAD_ENV_DECC\\)|def _PTHREAD_ENV_DECC)(.*))\n"
"(#[ \t]*define _PTHREAD_USE_PTDNAM_)";
mach = "alpha*-dec-osf*";
c_fix = format;
- c_fix_arg = "%1 || defined (__PRAGMA_EXTERN_PREFIX)\n%2";
+ c_fix_arg = "%2 defined (_PTHREAD_ENV_DECC)%4 || defined (__PRAGMA_EXTERN_PREFIX)\n%5";
test_text = "# if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC)\n"
"# define _PTHREAD_USE_PTDNAM_\n"
+ "# endif\n"
+ "# ifdef _PTHREAD_ENV_DECC\n"
+ "# define _PTHREAD_USE_PTDNAM_\n"
"# endif";
};
@@ -734,20 +776,31 @@ fix = {
select = "^[ \t]*#[ \t]*pragma[ \t]+extern_prefix";
- files = libgen.h;
files = dirent.h;
files = ftw.h;
files = grp.h;
+ files = libgen.h;
files = ndbm.h;
files = pthread.h;
files = pwd.h;
files = signal.h;
files = standards.h;
+ files = stdio.h;
files = stdlib.h;
files = string.h;
files = stropts.h;
+ files = sys/mount.h;
+ files = sys/resource.h;
+ files = sys/signal.h;
+ files = sys/socket.h;
+ files = sys/stat.h;
+ files = sys/stropts.h;
+ files = sys/uio.h;
files = time.h;
files = unistd.h;
+ files = utmp.h;
+ files = utmpx.h;
+ files = wchar.h;
sed =
"s/^[ \t]*#[ \t]*define[ \t][ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
diff --git a/gcc/fixinc/tests/base/libgen.h b/gcc/fixinc/tests/base/dirent.h
index 85328f4..55a76d1 100644
--- a/gcc/fixinc/tests/base/libgen.h
+++ b/gcc/fixinc/tests/base/dirent.h
@@ -2,7 +2,7 @@
It has been auto-edited by fixincludes from:
- "fixinc/tests/inc/libgen.h"
+ "fixinc/tests/inc/dirent.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
diff --git a/gcc/fixinc/tests/base/pthread.h b/gcc/fixinc/tests/base/pthread.h
index bd10f5a..385c055 100644
--- a/gcc/fixinc/tests/base/pthread.h
+++ b/gcc/fixinc/tests/base/pthread.h
@@ -19,6 +19,9 @@
# if defined (_PTHREAD_ENV_DECC) || defined (_PTHREAD_ENV_EPCC) || defined (__PRAGMA_EXTERN_PREFIX)
# define _PTHREAD_USE_PTDNAM_
# endif
+# if defined (_PTHREAD_ENV_DECC) || defined (__PRAGMA_EXTERN_PREFIX)
+# define _PTHREAD_USE_PTDNAM_
+# endif
#endif /* ALPHA_PTHREAD_CHECK */
diff --git a/gcc/fixinc/tests/base/standards.h b/gcc/fixinc/tests/base/standards.h
new file mode 100644
index 0000000..fccf806
--- /dev/null
+++ b/gcc/fixinc/tests/base/standards.h
@@ -0,0 +1,14 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/standards.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( ALPHA___EXTERN_PREFIX_STANDARDS_CHECK )
+#if (_ISO_C_SOURCE>=19990L) && !defined(_LIBC_POLLUTION_H_) && !defined(__DECC) && !defined(__PRAGMA_EXTERN_PREFIX)
+#endif /* ALPHA___EXTERN_PREFIX_STANDARDS_CHECK */
diff --git a/gcc/fixinc/tests/base/sys/stat.h b/gcc/fixinc/tests/base/sys/stat.h
index 9257748..c2b2fb6 100644
--- a/gcc/fixinc/tests/base/sys/stat.h
+++ b/gcc/fixinc/tests/base/sys/stat.h
@@ -9,9 +9,9 @@
-#if defined( ALPHA___EXTERN_PREFIX_CHECK )
+#if defined( ALPHA___EXTERN_PREFIX_SYS_STAT_CHECK )
# if defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX)
-#endif /* ALPHA___EXTERN_PREFIX_CHECK */
+#endif /* ALPHA___EXTERN_PREFIX_SYS_STAT_CHECK */
#if defined( RS6000_FCHMOD_CHECK )
diff --git a/gcc/fixinc/tests/base/testing.h b/gcc/fixinc/tests/base/testing.h
index 5e660f8..81caa06 100644
--- a/gcc/fixinc/tests/base/testing.h
+++ b/gcc/fixinc/tests/base/testing.h
@@ -9,6 +9,16 @@
+#if defined( ALPHA___EXTERN_PREFIX_CHECK )
+#if (defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX))
+#pragma extern_prefix "_P"
+# if (defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX))
+# pragma extern_prefix "_E"
+# if !defined(_LIBC_POLLUTION_H_) && (defined(__DECC) || defined(__PRAGMA_EXTERN_PREFIX))
+# pragma extern_prefix ""
+#endif /* ALPHA___EXTERN_PREFIX_CHECK */
+
+
#if defined( AVOID_WCHAR_T_TYPE_CHECK )
#ifndef __cplusplus
typedef unsigned short wchar_t ;