summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-25 21:35:57 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-25 21:35:57 +0000
commite3e7d1c2029a646e0edad36cc7d3ad64dcab82bd (patch)
tree58be9a3cd9cef0f5c823ad1215f0017ac36649c8 /gcc
parentb467d89da6d59cdb4ad607213fa4c8c3f45a624c (diff)
downloadgcc-e3e7d1c2029a646e0edad36cc7d3ad64dcab82bd.tar.gz
* fixinc.wrap: Also handle struct queue in sys/stream.h.
* fixinc.svr4: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25449 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rwxr-xr-xgcc/fixinc.svr436
-rwxr-xr-xgcc/fixinc.wrap29
3 files changed, 69 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 75379f96bd0..aaedc35ff7e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Feb 25 21:32:34 1999 Jason Merrill <jason@yorick.cygnus.com>
+
+ * fixinc.wrap: Also handle struct queue in sys/stream.h.
+ * fixinc.svr4: Likewise.
+
Thu Feb 25 21:23:06 1999 Jason Merrill <jason@yorick.cygnus.com>
* dwarf2out.c (scope_die_for): Set scope_die to comp_unit_die
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4
index 9b86f4c0396..e633ed5bb15 100755
--- a/gcc/fixinc.svr4
+++ b/gcc/fixinc.svr4
@@ -1,7 +1,7 @@
#! /bin/sh
# Install modified versions of certain ANSI-incompatible
# native System V Release 4 system include files.
-# Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
# Contributed by Ron Guilmette (rfg@monkeys.com).
#
# This file is part of GNU CC.
@@ -1527,6 +1527,40 @@ if [ \! -z "$file_to_fix" ]; then
rm -f /tmp/$base
fi
+# Similarly for struct queue in sys/stream.h.
+file=sys/stream.h
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+ file_to_fix=${LIB}/$file
+else
+ if [ -r ${INPUT}/$file ]; then
+ file_to_fix=${INPUT}/$file
+ else
+ file_to_fix=""
+ fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+ echo Checking $file_to_fix
+ sed -e '/struct[ ]*queue/i\
+#ifdef __cplusplus\
+#define queue __stream_queue\
+#endif'\
+ -e '/struct[ ]*queue/a\
+#ifdef __cplusplus\
+#undef queue\
+#endif' $file_to_fix > /tmp/$base
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ true
+ else
+ echo Fixed $file_to_fix
+ mkdir -p $LIB/`dirname $file`
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ chmod a+r ${LIB}/$file
+ fi
+ rm -f /tmp/$base
+fi
+
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
diff --git a/gcc/fixinc.wrap b/gcc/fixinc.wrap
index 406c87e9c03..bb783f95589 100755
--- a/gcc/fixinc.wrap
+++ b/gcc/fixinc.wrap
@@ -53,6 +53,35 @@ __EOF__
fi
fi
+# Similarly for struct queue in sys/stream.h.
+file=sys/stream.h
+if [ -r $INPUT/$file ]; then
+ echo Checking $INPUT/$file
+ if grep 'struct[ ]*queue' $INPUT/$file >/dev/null
+ then
+ echo Fixed $file
+ mkdir -p $LIB/`dirname $file`
+ rm -f $LIB/$file
+ cat <<'__EOF__' >$LIB/$file
+#ifndef _SYS_STREAM_H_WRAPPER
+#ifdef __cplusplus
+# define queue __stream_queue
+#endif
+#include_next <sys/stream.h>
+#ifdef __cplusplus
+# undef queue
+#endif
+#define _SYS_STREAM_H_WRAPPER
+#endif /* _SYS_STREAM_H_WRAPPER */
+__EOF__
+ # Define _SYS_STREAM_H_WRAPPER at the end of the wrapper, not the start,
+ # so that if #include_next gets another instance of the wrapper,
+ # this will follow the #include_next chain until we arrive at
+ # the real <sys/stream.h>.
+ chmod a+r $LIB/$file
+ fi
+fi
+
# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
# g++, since it's now an official type in the C++ language.
file=curses.h