summaryrefslogtreecommitdiffstats
path: root/gcc/fixinc.svr4
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-10-07 21:58:26 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-10-07 21:58:26 +0000
commitf2aed5195f2dfeb1aa72883f231f6a2036302cc5 (patch)
tree6eb0df7d787254b56a378d72801ec35986fe0286 /gcc/fixinc.svr4
parentcf6a3b883078ae099136232bdadd635724c2c12b (diff)
downloadppe42-gcc-f2aed5195f2dfeb1aa72883f231f6a2036302cc5.tar.gz
ppe42-gcc-f2aed5195f2dfeb1aa72883f231f6a2036302cc5.zip
(<sys/signal.h>): Fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD.
(<sys/stat.h>): Turn definitions of stat, lstat, fstat, and mknod into ANSI syntax and add __ to variables used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2362 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc.svr4')
-rwxr-xr-xgcc/fixinc.svr460
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4
index fa0bae0144b..cf04a2c4761 100755
--- a/gcc/fixinc.svr4
+++ b/gcc/fixinc.svr4
@@ -501,6 +501,7 @@ EOF
fi
# Add a #define of _SIGACTION_ into <sys/signal.h>.
+# Also fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD.
file=sys/signal.h
base=`basename $file`
@@ -522,6 +523,7 @@ if [ \! -z "$file_to_fix" ]; then
#define _SIGACTION_
struct sigaction {
.
+ 1,\$s/(void *(\*)())/(void (*)(int))/
wq
EOF
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
@@ -860,6 +862,64 @@ if [ \! -z "$file_to_fix" ]; then
fi
fi
+# Convert functions to prototype form, and fix arg names in <sys/stat.h>.
+
+file=sys/stat.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
+ cp $file_to_fix /tmp/$base
+ chmod +w /tmp/$base
+ ex /tmp/$base <<EOF
+/^stat(path, buf)/j
+j
+-
+/^stat(path, buf)/c
+stat (const char *path, struct stat *buf)
+.
+/^lstat(path, buf)/j
+j
+-
+/^lstat(path, buf)/c
+lstat (const char *path, struct stat *buf)
+.
+/^fstat(fd, buf)/j
+j
+-
+/^fstat(fd, buf)/c
+fstat (int fd, struct stat *buf)
+.
+/^mknod(path, mode, dev)/j
+j
+j
+-
+/^mknod(path, mode, dev)/c
+mknod (const char *path, mode_t mode, dev_t dev)
+.
+1,\$s/path/__path/g
+1,\$s/buf/__buf/g
+1,\$s/fd/__fd/g
+1,\$s/ret\\([^u]\\)/__ret\1/g
+1,\$s/\\([^_]\\)mode\\([^_]\\)/\\1__mode\\2/g
+1,\$s/\\([^_r]\\)dev\\([^_]\\)/\\1__dev\\2/g
+wq
+EOF
+ echo Fixed $file_to_fix
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ rm -f /tmp/$base
+ fi
+fi
+
# Sony NEWSOS 5.0 does not support the complete ANSI C standard.
if [ -x /bin/sony ]; then
OpenPOWER on IntegriCloud