aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixincludes
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1996-01-11 16:28:49 +0000
committerDoug Evans <dje@gnu.org>1996-01-11 16:28:49 +0000
commitffc1e7b2e9b1fb7feef1c158f442afc32729c7f1 (patch)
treed5d837f4bd6dfc687a962bdd6b7962fa50f8d0ec /gcc/fixincludes
parentf9da1f35792bae30bf9ba032211a973aef3c437f (diff)
downloadgcc-ffc1e7b2e9b1fb7feef1c158f442afc32729c7f1.zip
gcc-ffc1e7b2e9b1fb7feef1c158f442afc32729c7f1.tar.gz
gcc-ffc1e7b2e9b1fb7feef1c158f442afc32729c7f1.tar.bz2
* fixincludes: Wrap rpc/types.h in extern "C", for osf2.0.
From-SVN: r10961
Diffstat (limited to 'gcc/fixincludes')
-rwxr-xr-xgcc/fixincludes35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index c20d8ea..9ef8566 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -1782,6 +1782,41 @@ if [ -r ${LIB}/$file ]; then
fi
fi
+# rpc/types.h on OSF1/2.0 is not C++ ready, even though NO_IMPLICIT_EXTERN_C
+# is defined for the alpha. The problem is the declaration of malloc.
+file=rpc/types.h
+ls -l $file ${LIB}/$file
+if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+ mkdir ${LIB}/rpc 2>/dev/null
+ 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
+ if egrep '"C"' ${LIB}/$file >/dev/null 2>&1; then
+ true
+ else
+ echo Fixing $file
+ echo '#ifdef __cplusplus
+extern "C" {
+#endif' > ${LIB}/${file}.sed
+ cat ${LIB}/${file} >> ${LIB}/${file}.sed
+ echo '#ifdef __cplusplus
+}
+#endif' >> ${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
+fi
+
# In limits.h, put #ifndefs around things that are supposed to be defined
# in float.h to avoid redefinition errors if float.h is included first.
# On HP/UX this patch does not work, because on HP/UX limits.h uses