libg++/curses fix for OSR5 committed.

Bruce Korb korbb@datadesign.com
Thu Sep 10 07:04:00 GMT 1998


Robert Lipe wrote:

> Before I spend the time beating fixinc.sco with a suitable stick, then
> turning around and doing something similar with fixinc.svr4 (which
> my svr5 target uses, too) and then doing it again with the generic
> fixincludes to find out that libg++ is just broken and we're a week away
> from changing to fast-fixinc, could I have some advice on a direction to
> take, please?

I would *highly* recommend hacking adapting fixincludes to the two new files and
either moving that text verbatim to the other fixinc.* files, or adopting
fixincludes in toto.  Below is the text from fixincludes that was
adapted to fast-fixinc.  The main reason for the recommendation is that
at some point it will become necessary to locate fixup text that lives
in the fixinc.* files, but has no counterpart in fixincludes.  The fix
that fixinc.wrap has, duplicates the below functionality and must be
carefully examined before being discarded.  I am not excited about carefully
examining every line of the fixinc.* files, therefore lets maximize the
exact copying of text!


# For C++, avoid any typedef or macro definition of bool, and use the
# built in type instead.
for files in curses.h term.h tinfo.h ; do
  if [ -r $file ] && egrep bool $file >/dev/null 2>&1; then
    if [ ! -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

    echo Fixing $file
    sed -e '/^#[        ]*define[       ][      ]*bool[         ][      ]*char[        ]*$/i\
#ifndef __cplusplus
'\
        -e '/^#[        ]*define[       ][      ]*bool[         ][      ]*char[        ]*$/a\
#endif
'\
        -e '/^typedef[  ][      ]*char[         ][      ]*bool[         ]*;/i\
#ifndef __cplusplus
'\
        -e '/^typedef[  ][      ]*char[         ][      ]*bool[         ]*;/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
      rm -f ${LIB}/$file
    else
      # Find any include directives that use "file".
      for include in `egrep '^[       ]*#[    ]*include[      ]*"[^/]' ${LIB}/$file |
           sed -e 's/^[    ]*#[    ]*include[      ]*"\([^"]*\)".*$/\1/'`; do
        dir=`echo $file | sed -e s'|/[^/]*$||'`
        required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include"
      done
    fi
  fi
done





More information about the Gcc-patches mailing list