diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-09-28 15:41:21 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-09-28 15:41:21 -0700 |
commit | 303b6ca3e8b075098c1d17147d198849d5868a1f (patch) | |
tree | d2ce572775c919e2e468e4a3a09f280cb1412911 | |
parent | 6396c3f61cefceb104c2dad0fc246898c90d9f92 (diff) | |
download | gcc-303b6ca3e8b075098c1d17147d198849d5868a1f.zip gcc-303b6ca3e8b075098c1d17147d198849d5868a1f.tar.gz gcc-303b6ca3e8b075098c1d17147d198849d5868a1f.tar.bz2 |
(math.h): Put #ifndef around HUGE_VAL define.
From-SVN: r5509
-rwxr-xr-x | gcc/fixinc.svr4 | 31 | ||||
-rwxr-xr-x | gcc/fixincludes | 23 |
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4 index 55049a9..0f33bc2 100755 --- a/gcc/fixinc.svr4 +++ b/gcc/fixinc.svr4 @@ -1320,6 +1320,37 @@ EOF chmod a+r ${LIB}/$file fi +# In math.h, put #ifndefs around things that might be defined in a gcc +# specific math-*.h file. + +file=math.h +base=`basename $file` +if [ -r ${LIB}/$file ]; then + file_to_fix=${LIB}/$file +else + if [ -r ${INPUT}/$file ]; then + file_to_fix=${INPUT}/$file + else + file_to_fix="" + fi +fi +if [ \! -z "$file_to_fix" ]; then + echo Checking $file_to_fix + sed -e '/define[ ]HUGE_VAL[ ]/i\ +#ifndef HUGE_VAL'\ + -e '/define[ ]HUGE_VAL[ ]/a\ +#endif' $file_to_fix > /tmp/$base + if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ + true + else + echo Fixed $file_to_fix + rm -f ${LIB}/$file + cp /tmp/$base ${LIB}/$file + chmod a+r ${LIB}/$file + fi + rm -f /tmp/$base +fi + echo 'Removing unneeded directories:' cd $LIB files=`find . -type d -print | sort -r` diff --git a/gcc/fixincludes b/gcc/fixincludes index 7d453a2..655495b 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -1073,6 +1073,29 @@ if [ -r ${LIB}/$file ]; then fi fi +# In math.h, put #ifndefs around things that might be defined in a gcc +# specific math-*.h file. +file=math.h +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 + sed -e '/define[ ]HUGE_VAL[ ]/i\ +#ifndef HUGE_VAL'\ + -e '/define[ ]HUGE_VAL[ ]/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 + echo Deleting ${LIB}/$file\; no fixes were needed. + rm -f ${LIB}/$file + fi +fi + # These two files on SunOS 4 are included by other files # in the same directory, using "...". So we must make sure they exist # in the same directory as the other fixed files. |