diff options
author | Richard Stallman <rms@gnu.org> | 1993-01-06 10:11:52 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-01-06 10:11:52 +0000 |
commit | 6ef797eaac447ab835cc6f2c7ff5aec8d9c81030 (patch) | |
tree | 98902b55f7021f8dbdae80626239608bc704aaf0 | |
parent | 7488be4e12f74057f78d0452881f4b9cfa228d18 (diff) | |
download | gcc-6ef797eaac447ab835cc6f2c7ff5aec8d9c81030.zip gcc-6ef797eaac447ab835cc6f2c7ff5aec8d9c81030.tar.gz gcc-6ef797eaac447ab835cc6f2c7ff5aec8d9c81030.tar.bz2 |
(limits.h): Add #ifndef/#endif around macros that
are supposed to be defined in float.h.
From-SVN: r3118
-rwxr-xr-x | gcc/fixincludes | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index 1e70518..d91589a 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -865,6 +865,49 @@ if [ -r ${LIB}/$file ]; then 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. +file=limits.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 '/[ ]FLT_MIN[ ]/i\ +#ifndef FLT_MIN'\ + -e '/[ ]FLT_MIN[ ]/a\ +#endif'\ + -e '/[ ]FLT_MAX[ ]/i\ +#ifndef FLT_MAX'\ + -e '/[ ]FLT_MAX[ ]/a\ +#endif'\ + -e '/[ ]FLT_DIG[ ]/i\ +#ifndef FLT_DIG'\ + -e '/[ ]FLT_DIG[ ]/a\ +#endif'\ + -e '/[ ]DBL_MIN[ ]/i\ +#ifndef DBL_MIN'\ + -e '/[ ]DBL_MIN[ ]/a\ +#endif'\ + -e '/[ ]DBL_MAX[ ]/i\ +#ifndef DBL_MAX'\ + -e '/[ ]DBL_MAX[ ]/a\ +#endif'\ + -e '/[ ]DBL_DIG[ ]/i\ +#ifndef DBL_DIG'\ + -e '/[ ]DBL_DIG[ ]/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. |