libg++/curses fix for OSR5 committed.

Bruce Korb korbb@datadesign.com
Wed Sep 9 16:56:00 GMT 1998


Jeffrey A Law wrote:

>   > > Should the curses.h problem be fixed by fixincludes?
>   > Jason> Yes.  You could just copy the code out of fixinc.wrap.
>   >
>   > The following patch to fix this for OpenServer has now been committed.
>   > I've verified that this allows libg++ to build and pass a 'make check'.
>   >
>   > I haven't yet decided if this is broken on any of the UnixWare or UDK
>   > targets.   If so, I'll fix them similarly.
> I've never looked at the wrapper stuff.  So take this with a grain of
> salt...

> Any chance you could add this to the standard fixincludes script?  This
> problem occurs on quite a few systems.
>
> Bruce, this is something we'll need the new fixinc stuff to do too.

Too late, methinks.  This fix has been the new fixinc since forever:

  /*
   *  For C++, avoid any typedef or macro definition of bool,
   *  and use the built in type instead.
   */
  fix = {
    hackname = avoid_bool;
    files    = curses.h;

    sed = "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/i\\\n"
                "#ifndef __cplusplus\n";

    sed = "/^#[ \t]*define[ \t][ \t]*bool[ \t][ \t]*char[ \t]*$/a\\\n"
                "#endif\n";

    sed = "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/i\\\n"
                "#ifndef __cplusplus\n";

    sed = "/^typedef[ \t][ \t]*char[ \t][ \t]*bool[ \t]*;/a\\\n"
                "#endif\n";
  };

This is different than the "fixinc.wrap" approach.  That approach is to
#define "bool" for the duration of processing the file "curses.h"
and then "#include_next" the original.  That approach will *fail* if
there are other fixes that need to be applied to "curses.h" because
it uses a fixed-contentent wrapper file that would displace any other
applied fixes.  This approach merely disables #define-d and typedef-ed
remappings of "bool" for __cplusplus compiles.




More information about the Gcc-patches mailing list