mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-17 05:10:28 +08:00
Fix signal prototype on SunOS to avoid C++ pedantic error
From-SVN: r11652
This commit is contained in:
parent
e8621b3c1c
commit
cf0a001cb1
@ -2568,9 +2568,48 @@ if [ -r ${LIB}/$file ]; then
|
||||
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
|
||||
|
||||
# signal.h on SunOS defines signal using (), which causes trouble when
|
||||
# compiling with g++ -pedantic.
|
||||
for file in signal.h sys/signal.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 "Checking for bad C++ prototype in $file"
|
||||
sed -e '/^void (\*signal())();$/i\
|
||||
#ifdef __cplusplus\
|
||||
void (*signal(...))(...);\
|
||||
#else
|
||||
' \
|
||||
-e '/^void (\*signal())();$/a\
|
||||
#endif
|
||||
' \
|
||||
${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 -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
|
||||
done
|
||||
|
||||
# This loop does not appear to do anything, because it uses file
|
||||
# rather than $file when setting target. It also appears to be
|
||||
# unnecessary, since the main loop processes symbolic links.
|
||||
|
Loading…
x
Reference in New Issue
Block a user