* fixincludes: Wrap rpc/types.h in extern "C", for osf2.0.
From-SVN: r10961
This commit is contained in:
parent
f9da1f3579
commit
ffc1e7b2e9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user