diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-12-16 12:03:25 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-12-16 12:03:25 +0000 |
commit | 0a6877ca72d56f420cb587395477222add4b843c (patch) | |
tree | d858799c0207e4be127fc6574f5c438e8e52bb57 /gcc/fixincludes | |
parent | 7afc9620b13a3a16e516024d63ea8868122963f0 (diff) | |
download | gcc-0a6877ca72d56f420cb587395477222add4b843c.tar.gz |
(stdio.h): Fix return type of fread and fwrite on sysV68.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixincludes')
-rwxr-xr-x | gcc/fixincludes | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index cc8801d349b..c20d8ea9a4c 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -1234,6 +1234,31 @@ EOF fi fi +# Fix return type of fread and fwrite on sysV68 +file=stdio.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 + chmod a+r ${LIB}/$file 2>/dev/null +fi + +if [ -r ${LIB}/$file ]; then + echo Fixing $file, fread and fwrite return type + sed -e 's/^\(extern int fclose(), fflush()\), \(fread(), fwrite()\)\(.*\)$/extern unsigned int \2;\ +\1\3/' \ + ${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 + # parameters not const on DECstation Ultrix V4.0 and OSF/1. file=stdio.h if [ -r $file ] && [ ! -r ${LIB}/$file ]; then |