From 2dbb8078bf1a26e87a1c1ba350c4a4dedf4bbe4c Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 24 Sep 1996 08:00:06 -0400 Subject: [PATCH] Insert newlines just before end of 'sed' command strings if last 'sed' command is 'a' or 'i'. From-SVN: r12830 --- gcc/fixinc.ptx | 8 ++++-- gcc/fixinc.svr4 | 75 +++++++++++++++++++++++++++++++------------------ gcc/fixincludes | 12 +++++--- 3 files changed, 61 insertions(+), 34 deletions(-) diff --git a/gcc/fixinc.ptx b/gcc/fixinc.ptx index d66998dd17a1..7464205dd800 100644 --- a/gcc/fixinc.ptx +++ b/gcc/fixinc.ptx @@ -129,7 +129,8 @@ if [ \! -z "$file_to_fix" ]; then \ #if defined(__STDC__) || defined(__cplusplus)\ #include \ -#endif /* __STDC__ */' \ +#endif /* __STDC__ */ +' \ $file_to_fix > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file echo Fixed $file_to_fix @@ -183,10 +184,11 @@ if [ \! -z "$file_to_fix" ]; then \ #if defined (__GNUC__) || defined (__GNUG__)\ #include \ -#else /* not __GNUC__ */\ +#else /* not __GNUC__ */ ' \ -e '/#endif[ ]*\/\* NETSWAP \*\//i\ -#endif /* not __GNUC__ */' \ +#endif /* not __GNUC__ */ +' \ $file_to_fix > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file echo Fixed $file_to_fix diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4 index cb1517d81e90..bf00c03091d5 100755 --- a/gcc/fixinc.svr4 +++ b/gcc/fixinc.svr4 @@ -1,9 +1,8 @@ #! /bin/sh -# -# fixinc.svr4 -- Install modified versions of certain ANSI-incompatible -# native System V Release 4 system include files. -# -# Written by Ron Guilmette (rfg@ncd.com). +# Install modified versions of certain ANSI-incompatible +# native System V Release 4 system include files. +# Copyright (C) 1994, 1996 Free Software Foundation, Inc. +# Contributed by Ron Guilmette (rfg@monkeys.com). # # This file is part of GNU CC. # @@ -476,14 +475,16 @@ else static\ #else\ extern\ -#endif'\ +#endif +'\ -e 's/extern \(int ftw(const.*\)$/\1/' \ -e '/^extern int nftw/i\ #if defined(_STYPES)\ static\ #else\ extern\ -#endif'\ +#endif +'\ -e 's/extern \(int nftw.*\)$/\1/' \ -e '/^extern int ftw(),/c\ #if !defined(_STYPES)\ @@ -1029,9 +1030,11 @@ fi # true # else # sed -e '/#ifdef INKERNEL/i\ -# #ifdef _KERNEL' \ +# #ifdef _KERNEL +# ' \ # -e '/#endif[ ]*\/\* INKERNEL \*\//a\ -# #endif /* _KERNEL */' \ +# #endif /* _KERNEL */ +# ' \ # $file_to_fix > ${LIB}/${file}.sed # rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file # echo Fixed $file_to_fix @@ -1057,10 +1060,12 @@ if [ \! -z "$file_to_fix" ]; then true else sed -e '/# ifdef __STDC__/i\ -# if !defined (__GNUC__) && !defined (__GNUG__)' \ +# if !defined (__GNUC__) && !defined (__GNUG__) +' \ -e '/# include /s/ / /'\ -e '/# include /i\ -# endif /* !defined (__GNUC__) && !defined (__GNUG__) */'\ +# endif /* !defined (__GNUC__) && !defined (__GNUG__) */ +'\ $file_to_fix > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file echo Fixed $file_to_fix @@ -1336,29 +1341,41 @@ fi if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e '/[ ]FLT_MIN[ ]/i\ -#ifndef FLT_MIN'\ +#ifndef FLT_MIN +'\ -e '/[ ]FLT_MIN[ ]/a\ -#endif'\ +#endif +'\ -e '/[ ]FLT_MAX[ ]/i\ -#ifndef FLT_MAX'\ +#ifndef FLT_MAX +'\ -e '/[ ]FLT_MAX[ ]/a\ -#endif'\ +#endif +'\ -e '/[ ]FLT_DIG[ ]/i\ -#ifndef FLT_DIG'\ +#ifndef FLT_DIG +'\ -e '/[ ]FLT_DIG[ ]/a\ -#endif'\ +#endif +'\ -e '/[ ]DBL_MIN[ ]/i\ -#ifndef DBL_MIN'\ +#ifndef DBL_MIN +'\ -e '/[ ]DBL_MIN[ ]/a\ -#endif'\ +#endif +'\ -e '/[ ]DBL_MAX[ ]/i\ -#ifndef DBL_MAX'\ +#ifndef DBL_MAX +'\ -e '/[ ]DBL_MAX[ ]/a\ -#endif'\ +#endif +'\ -e '/[ ]DBL_DIG[ ]/i\ -#ifndef DBL_DIG'\ +#ifndef DBL_DIG +'\ -e '/[ ]DBL_DIG[ ]/a\ -#endif' $file_to_fix > /tmp/$base +#endif +' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ true else @@ -1409,9 +1426,11 @@ fi if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e '/define[ ]HUGE_VAL[ ]/i\ -#ifndef HUGE_VAL'\ +#ifndef HUGE_VAL +'\ -e '/define[ ]HUGE_VAL[ ]/a\ -#endif' $file_to_fix > /tmp/$base +#endif +' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ true else @@ -1440,9 +1459,11 @@ for file in math.h floatingpoint.h; do if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix sed -e '/^#define[ ]*__P/i\ -#ifndef __P'\ +#ifndef __P +'\ -e '/^#define[ ]*__P/a\ -#endif' $file_to_fix > /tmp/$base +#endif +' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ true else diff --git a/gcc/fixincludes b/gcc/fixincludes index 5b7ddfc0c76c..f4803b728ff5 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -2078,13 +2078,17 @@ for files in curses.h; do echo Fixing $file sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\ -#ifndef __cplusplus'\ +#ifndef __cplusplus +'\ -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\ -#endif'\ +#endif +'\ -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/i\ -#ifndef __cplusplus'\ +#ifndef __cplusplus +'\ -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\ -#endif'\ +#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