diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-12-22 22:40:52 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-12-22 22:40:52 +0000 |
commit | 7f0b898713371ed4c37f2ccf606a7f451cdc1be1 (patch) | |
tree | cd3a0f9b46f2cccbdde9d602b48bc8dd7cc3bf2a /gcc/fixinc.svr4 | |
parent | 088965facada94ed53b413a32663dcb384783fdd (diff) | |
download | gcc-7f0b898713371ed4c37f2ccf606a7f451cdc1be1.tar.gz |
Add special fixes for netinet/in.h and sys/endian.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2902 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc.svr4')
-rwxr-xr-x | gcc/fixinc.svr4 | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4 index 3d5c44e4e69..fd1724bcf4a 100755 --- a/gcc/fixinc.svr4 +++ b/gcc/fixinc.svr4 @@ -903,6 +903,90 @@ if [ \! -z "$file_to_fix" ]; then fi fi +# Conditionalize some of <netinet/in.h> on _KERNEL being defined. + +file=netinet/in.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 + if grep _KERNEL $file_to_fix > /dev/null; then + echo No change needed in $file_to_fix + else + sed -e '/#ifdef INKERNEL/i\ +#ifdef _KERNEL' \ + -e '/* INKERNEL */a\ +#endif /* _KERNEL */' \ + ${LIB}/$file > ${LIB}/${file}.sed + rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file + echo Fixed $file_to_fix + fi +fi + +# Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__. + +file=sys/endian.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 + if grep __GNUC__ $file_to_fix > /dev/null; then + echo No change needed in $file_to_fix + else + sed -e '/# ifdef __STDC__/i\ +# if !defined (__GNUC__) && !defined (__GNUG__)' \ + -e ' unsigned long ntohl(), htonl();\ +# endif/a\ +# endif /* !defined (__GNUC__) && !defined (__GNUG__) */\ +# include <sys/byteorder.h>' \ + ${LIB}/$file > ${LIB}/${file}.sed + rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file + echo Fixed $file_to_fix + fi +fi + +# Commented out because tmcconne@sedona.intel.com says we don't clearly need it +# and the text in types.h is not erroneous. +## In sys/types.h, don't name the enum for booleans. +# +#file=sys/types.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 +# if grep "enum boolean" $file_to_fix > /dev/null; then +# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed +# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file +# echo Fixed $file_to_fix +# else +# echo No change needed in $file_to_fix +# fi +#fi + # Remove useless extern keyword from struct forward declarations in # <sys/stream.h> and <sys/strsubr.h> |