summaryrefslogtreecommitdiff
path: root/gcc/fixinc
diff options
context:
space:
mode:
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-05 17:44:07 +0000
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-05 17:44:07 +0000
commit302d712d82fd904a34fbc1ee94ff19ef37891975 (patch)
tree376c036b4370078aded7607e4703aff2de29b3b5 /gcc/fixinc
parenta5380b83c9d0d99e1fc4ef6296c9adc6db9982b8 (diff)
downloadgcc-302d712d82fd904a34fbc1ee94ff19ef37891975.tar.gz
New include hacks for ultrix
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc')
-rw-r--r--gcc/fixinc/inclhack.def162
1 files changed, 147 insertions, 15 deletions
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 85e1d47749f..ec1b0f3d30f 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -517,6 +517,65 @@ fix = {
/*
+ * The Ultrix 4.3 file limits.h is a symbolic link to sys/limits.h.
+ * Replace limits.h with a file that includes sys/limits.h.
+ */
+fix = {
+ hackname = AAB_ultrix_limits;
+ files = limits.h;
+ mach = "*-*-ultrix4.3";
+ replace =
+'/* @(#)limits.h */
+/* This file was generated by fixincludes */
+\#ifndef _LIMITS_INCLUDED
+\#define _LIMITS_INCLUDED
+\#include <sys/limits.h>
+\#endif /* _LIMITS_INCLUDED */
+';
+};
+
+
+/*
+ * The ULTRIX 4.3 version of memory.h duplicates definitions
+ * present in strings.h. Replace memory.h with a file that includes
+ * strings.h to prevent problems from multiple inclusion.
+ */
+fix = {
+ hackname = AAB_ultrix_memory;
+ files = memory.h;
+ mach = "*-*-ultrix4.3";
+ replace =
+'/* @(#)memory.h */
+/* This file was generated by fixincludes */
+\#ifndef _MEMORY_INCLUDED
+\#define _MEMORY_INCLUDED
+\#include <strings.h>
+\#endif /* _MEMORY_INCLUDED */
+';
+};
+
+
+/*
+ * The Ultrix 4.3 file string.h is a symbolic link to strings.h.
+ * Replace string.h link with a file that includes strings.h to prevent
+ * problems from multiple inclusion.
+ */
+fix = {
+ hackname = AAB_ultrix_string;
+ files = string.h;
+ mach = "*-*-ultrix4.3";
+ replace =
+'/* @(#)string.h */
+/* This file was generated by fixincludes */
+\#ifndef _STRING_INCLUDED
+\#define _STRING_INCLUDED
+\#include <strings.h>
+\#endif /* _STRING_INCLUDED */
+';
+};
+
+
+/*
* sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
* definition of struct rusage, so the prototype added by fixproto fails.
*/
@@ -1490,16 +1549,6 @@ fix = {
/*
- * Avoid nested comments on Ultrix 4.3.
- */
-fix = {
- hackname = nested_ultrix;
- files = rpc/svc.h;
- sed = "s@^\\( \\*\tint protocol; \\)/\\*@\\1*/ /*@";
-};
-
-
-/*
* fix bogus recursive stdlib.h in NEWS-OS 4.0C
*/
fix = {
@@ -2616,7 +2665,10 @@ fix = {
files = math.h;
select = "atof\\([ \t]*char";
- sed = "s@atof(\\([ \t]*char[ \t]*\\*[^)]*\\))@atof(const \\1)@";
+ c_fix = format;
+ c_fix_arg = "atof(const char";
+
+ test_text = "extern double atof( char *__nptr);\n";
};
@@ -2672,8 +2724,10 @@ fix = {
hackname = ultrix_fix_fixproto;
files = sys/utsname.h;
select = ULTRIX;
- sed = "/^[ \t]*extern[ \t]*int[ \t]*uname();$/i\\\n"
- "struct utsname;\n";
+
+ c_fix = format;
+ c_fix_arg = "struct utsname;\n%0";
+ c_fix_arg = "^[ \t]*extern[ \t]*int[ \t]*uname\\(\\);"
test_text =
"/* ULTRIX's uname */\nextern\tint\tuname();";
@@ -2685,9 +2739,11 @@ fix = {
*/
fix = {
hackname = ultrix_ifdef;
- select = "#ifdef KERNEL[ \t]+[^ \t]";
+ select = "^#ifdef KERNEL[ \t]+&&";
files = sys/file.h;
- sed = "s/#ifdef KERNEL/#if defined(KERNEL)/";
+
+ c_fix = format;
+ c_fix_arg = "#if defined(KERNEL) &&";
test_text =
"#ifdef KERNEL\t&& defined( mumbojumbo )\nint oops;\n#endif";
@@ -2695,6 +2751,66 @@ fix = {
/*
+ * Strip "|| CC$gfloat" from Ultrix math headers.
+ */
+fix = {
+ hackname = ultrix_math_ifdef;
+ files = float.h;
+ files = math.h;
+ files = sys/limits.h;
+ select = "^#if.*\\|\\|[ \t]+CC\\$[a-z]+";
+ sed = "/^#if/s/||[ \t][ \t]*CC$[a-z][a-z]*//";
+ test_text = '#if defined(__GFLOAT) || CC\$gfloat';
+};
+
+
+/*
+ * Avoid nested comments on Ultrix 4.3.
+ */
+fix = {
+ hackname = ultrix_nested_ioctl;
+ files = sys/ioctl.h;
+ select = "^/\\* #define SIOCSCREEN";
+ sed = "/^\\/\\* #define SIOCSCREEN/s@/\\* screend@*//* screend@";
+ test_text =
+ "/* #define SIOCSCREENON _IOWR('i', 49, int)"
+ "/* screend, net/gw_screen.h */\n";
+};
+
+
+fix = {
+ hackname = ultrix_nested_svc;
+ files = rpc/svc.h;
+ select = "^ \\*[ \t]*int protocol; */\\*";
+ sed = "s@^\\( \\*\tint protocol; \\)/\\*@\\1*/ /*@";
+ test_text =
+ " *\tint protocol; /* like TCP or UDP\n";
+};
+
+
+/*
+ * Add missing prototype for lstat and define for S_ISLNK
+ * in Ultrix V4.3 sys/stat.h.
+ */
+fix = {
+ hackname = ultrix_stat;
+ files = sys/stat.h;
+ select = "@\\(#\\)stat\\.h.*6\\.1.*\\(ULTRIX\\)";
+ sed = "/^#define[ \t]S_IFPORT[ \t]*S_IFIFO$/a\\\n"
+ "\\\n"
+ "/* macro to test for symbolic link */\\\n"
+ "#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)\\\n"
+ "\n";
+ sed = "/^[ \t]*fstat(),$/a\\\n"
+ "\tlstat(),\n";
+ test_text =
+ "@(#)stat.h 6.1 (ULTRIX)\n"
+ "#define S_IFPORT S_IFIFO\n"
+ "\tfstat(),\n";
+};
+
+
+/*
* Check for superfluous `static' (in Ultrix 4.2)
* On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken.
*/
@@ -2705,6 +2821,22 @@ fix = {
sed = "s/^static struct tlb_pid_state/struct tlb_pid_state/";
sed = 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/';
sed = 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/';
+ test_text =
+ "static struct tlb_pid_state {\n"
+ "#include \"r3_cpu.h\"\n";
+};
+
+
+/*
+ * Add once-only latch to Ultrix V4.3 strings.h.
+ */
+fix = {
+ hackname = ultrix_strings;
+ files = strings.h;
+ select = "@\\(#\\)strings\\.h.*6\\.1.*\\(ULTRIX\\)";
+ c_fix = wrap;
+ test_text =
+ "@(#)strings.h 6.1 (ULTRIX)\n";
};