diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-05 23:18:02 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-05 23:18:02 +0000 |
commit | c5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80 (patch) | |
tree | 017db6c8be411c52ab98093e94dcce3c7ca3f029 /gcc/fixincludes | |
parent | 870d7a364fabca1efd21f7b8a996934ab7f91805 (diff) | |
download | gcc-c5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80.tar.gz |
* Check in merge from gcc2. See ChangeLog.12 for details.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixincludes')
-rwxr-xr-x | gcc/fixincludes | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index 8400c6f8055..b795a940aaf 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -411,6 +411,37 @@ typedef __SIZE_TYPE__ size_t;\ fi done +# Fix #defines under Alpha OSF/1: +# The following files contain '#pragma extern_prefix "_FOO"' followed by +# a '#define something(x,y,z) _FOOsomething(x,y,z)'. The intent of these +# statements is to reduce namespace pollution. While these macros work +# properly in most cases, they don't allow you to take a pointer to the +# "something" being modified. To get around this limitation, change these +# statements to be of the form '#define something _FOOsomething'. +for file in libgen.h dirent.h ftw.h grp.h ndbm.h pthread.h pwd.h signal.h standards.h stdlib.h string.h stropts.h time.h unistd.h +do + 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 extern_prefix + sed -e 's/^[ ]*#[ ]*define[ ]*\([^(]*\)\(([^)]*)\)[ ]*\(_.\)\1\2[ ]*$/#define \1 \3\1/' ${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 ${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 +done + # Fix one other error in this file: a mismatched quote not inside a C comment. file=sundev/vuid_event.h if [ -r $file ] && [ ! -r ${LIB}/$file ]; then @@ -1135,7 +1166,7 @@ if [ -r ${LIB}/$file ]; then fi fi -# And also with the HP-UX 10 sys/pci.h file +# And also with the HP-UX 10 and HP-UX 11 sys/pci.h file file=sys/pci.h if [ -r ${LIB}/$file ]; then if egrep 'System Private Structures' ${LIB}/$file > /dev/null; then @@ -1147,6 +1178,48 @@ if [ -r ${LIB}/$file ]; then fi fi +# And also with a few more HP-UX 11 headers which are only broken +# after they are "fixed". +file=sys/ki_iface.h +if [ -r ${LIB}/$file ]; then + if egrep 'These definitions are for HP Internal developers' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + fi +fi + +file=sys/ki.h +if [ -r ${LIB}/$file ]; then + if egrep '11.00 HP-UX LP64' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + fi +fi + +file=sys/ki_calls.h +if [ -r ${LIB}/$file ]; then + if egrep 'KI_MAX_PROCS is an arbitrary number' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + fi +fi + +file=sys/ki_defs.h +if [ -r ${LIB}/$file ] ; then + if egrep 'Kernel Instrumentation Definitions' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + fi +fi + +file=sys/time.h +if [ -r ${LIB}/$file ] ; then + if egrep 'For CASPEC, look in' ${LIB}/$file > /dev/null; then + echo Fixing $file, overeager sed script + rm ${LIB}/$file + fi +fi + # Some IRIX header files contains the string "//" for file in elf_abi.h elf.h; do if [ -r ${LIB}/$file ]; then |