aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixinc.svr4
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-17 21:21:32 +0000
committerRichard Stallman <rms@gnu.org>1992-10-17 21:21:32 +0000
commit5b6a946c3312328aa326f4c778bb2bb37feb71f4 (patch)
tree463c6b6a591a19c217117229ab2b8b174bc02b1e /gcc/fixinc.svr4
parenteae92d827e25a4ea7ce36da6690c876e532ea0b9 (diff)
downloadgcc-5b6a946c3312328aa326f4c778bb2bb37feb71f4.zip
gcc-5b6a946c3312328aa326f4c778bb2bb37feb71f4.tar.gz
gcc-5b6a946c3312328aa326f4c778bb2bb37feb71f4.tar.bz2
(string.h): Remove #defines for other compiler's builtin functions.
From-SVN: r2501
Diffstat (limited to 'gcc/fixinc.svr4')
-rwxr-xr-xgcc/fixinc.svr433
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4
index 0037506..8dcc882 100755
--- a/gcc/fixinc.svr4
+++ b/gcc/fixinc.svr4
@@ -500,6 +500,39 @@ EOF
rm -f /tmp/$base
fi
+# Disable apparent native compiler optimization cruft in SVR4.2 <string.h>
+# that is visible to any ANSI compiler using this include. Simply
+# delete the lines the #define some string functions to internal forms.
+
+file=string.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
+ g/#define.*__std_hdr_/d
+ wq
+EOF
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ echo No change needed in $file_to_fix
+ else
+ echo Fixed $file_to_fix
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ fi
+ rm -f /tmp/$base
+fi
+
# Add a #define of _SIGACTION_ into <sys/signal.h>.
# Also fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD.