diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-15 18:41:43 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-15 18:41:43 -0500 |
commit | f8e7d8e7c7381c0f134e9094b660865ac961a761 (patch) | |
tree | f07ac59b4a9c5fcc8e83bb1040c20e58cec28dff /gcc/fixincludes | |
parent | c9e39f3d12acbe04b1aefb7cd9e50f7401d714ea (diff) | |
download | gcc-f8e7d8e7c7381c0f134e9094b660865ac961a761.zip gcc-f8e7d8e7c7381c0f134e9094b660865ac961a761.tar.gz gcc-f8e7d8e7c7381c0f134e9094b660865ac961a761.tar.bz2 |
(sys/wait.h): Add forward declaration of struct rusage on AIX 3.2.5.
From-SVN: r10739
Diffstat (limited to 'gcc/fixincludes')
-rwxr-xr-x | gcc/fixincludes | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index ba6781d..cc8801d 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -1520,6 +1520,33 @@ if [ -r ${LIB}/$file ]; then fi fi +# 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) causes havoc. +file=sys/wait.h +if [ -r $file ] && [ ! -r ${LIB}/$file ]; then + cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" + chmod +w ${LIB}/$file 2>/dev/null +fi + +if [ -r ${LIB}/$file ] \ + && grep 'bos325,' ${LIB}/$file >/dev/null; then + echo Fixing $file, wait3 declaration + sed -e '/^extern pid_t wait3();$/i\ +struct rusage; +'\ + ${LIB}/$file > ${LIB}/${file}.sed + rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file + if cmp $file ${LIB}/$file >/dev/null 2>&1; then + rm -f ${LIB}/$file + else + # Find any include directives that use "file". + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do + dir=`echo $file | sed -e s'|/[^/]*$||'` + required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include" + done + fi +fi + # NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1. # Note that version 3 of the NeXT system has wait.h in a different directory, # so that this code won't do anything. But wait.h in version 3 has a |