[gnu.gcc.bug] gcc fixincludes script is broken by continued lines

jbw%bucsf.BU.EDU@BU-CS.BU.EDU (Joe Wells) (04/24/89)

The fixincludes script that comes with gcc 1.34 fails to transform
macro definitions like this:

#define	_IOR(x, y, t)	(IOC_OUT | ((sizeof (t) & IOCPARM_MASK) << 16) | \
			('x' << 8) | y)

This occurs because the macro definition is on two lines.  I have made
a change to fixincludes so that it will work no matter how many
continuation lines are used in a macro definition.  I'm including a
patch, for anyone who is interested.

Enjoy!

--
Joe Wells <jbw@bucsf.bu.edu>
jbw%bucsf.bu.edu@bu-it.bu.edu
...!harvard!bu-cs!bucsf!jbw
----------------------------------------------------------------------
*** fixincludes.orig	Sun Apr 23 16:52:24 1989
--- fixincludes	Sun Apr 23 16:34:49 1989
***************
*** 6,12 ****
  # for other versions, you had better check.
  
  # Directory in which to store the results.
! LIB=/usr15/degree/stud/jbw/gcc-include2
  
  echo 'Making directories:'
  cd /usr/include
--- 6,12 ----
  # for other versions, you had better check.
  
  # Directory in which to store the results.
! LIB=/usr15/degree/stud/jbw/gcc-include
  
  echo 'Making directories:'
  cd /usr/include
***************
*** 26,38 ****
        cp $file ${LIB}/$file >/dev/null 2>&1	\
        || echo "Can't copy $file"
        chmod +w ${LIB}/$file
!       ex ${LIB}/$file <<EOF
!       g/[ 	]_IO[A-Z]*(/s/(\(.\),/('\1',/
!       g/#define._IO/s/'x'/x/g
!       g/[^A-Z]CTRL[ 	]*(/s/\(.\))/'\1')/
!       g/#define.CTRL/s/'c'/c/g
!       wq
! EOF
        if cmp $file ${LIB}/$file >/dev/null 2>&1; then
           echo Deleting ${LIB}/$file\; no fixes were needed.
           rm ${LIB}/$file
--- 26,41 ----
        cp $file ${LIB}/$file >/dev/null 2>&1	\
        || echo "Can't copy $file"
        chmod +w ${LIB}/$file
!        sed -e '
! 				:loop
!        /\\$/			N
!        /\\$/			b loop
!        /[ 	]_IO[A-Z]*(/	s/(\(.\),/('\''\1'\'',/
!        /#define._IO/		s/'\''x'\''/x/g
!        /[^A-Z]CTRL[ 	]*(/	s/\(.\))/'\''\1'\'')/
!        /#define.CTRL/		s/'\''c'\''/c/g
!        ' ${LIB}/$file > ${LIB}/$file.sed
!        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 ${LIB}/$file