From: Ian Lance Taylor Date: Thu, 30 Jun 1994 20:08:45 +0000 (+0000) Subject: Wrap and to avoid multiple inclusion errors. X-Git-Tag: misc/cutover-egcs-0~6319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc026668404da5ca49520ea01647d3d452c3613f;p=thirdparty%2Fgcc.git Wrap and to avoid multiple inclusion errors. From-SVN: r7624 --- diff --git a/gcc/fixincludes b/gcc/fixincludes index 4f4618fa14dd..0254022e36c3 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -1710,6 +1710,24 @@ if [ -r ${LIB}/$file ]; then rm -f ${LIB}/$file fi +# Put cpp wrappers around these include files to avoid redeclaration +# errors during multiple inclusion on m88k-tektronix-sysv3. +for file in time.h sys/time.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 + fi + if [ -r ${LIB}/$file ]; then + echo Fixing $file, to protect against multiple inclusion. + cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'` + (echo "#ifndef __GCC_GOT_${cpp_wrapper}_" + echo "#define __GCC_GOT_${cpp_wrapper}_" + cat ${LIB}/${file} + echo '#endif /* !_GCC_GOT_'${cpp_wrapper}_' */') > ${LIB}/${file}.new + rm -f ${LIB}/$file; mv ${LIB}/${file}.new ${LIB}/$file + fi +done + echo 'Removing unneeded directories:' cd $LIB files=`find . -type d -print | sort -r`