fixinc vs "typedef int bool"

Jeffrey A Law law@cygnus.com
Tue Jun 8 00:11:00 GMT 1999


On aix4.2 curses.h has a bool typedef that looks like

typedef int bool;

fixinc only looks for "char" or "unsigned char".  Opps.

This bug causes libg++ to fail to build on aix4.2.

The attached patch should fix the problem.

	* fixinc/inclhack.def (avoid_bool): Also catch
	"typedef [unsigned] int bool".
	* fixinc/inclhack.sh, fixinc/fixincl.x, fixinc/fixincl.sh: Rebuilt.

Index: inclhack.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.14.4.3
diff -c -3 -p -r1.14.4.3 inclhack.def
*** inclhack.def	1999/06/07 20:34:55	1.14.4.3
--- inclhack.def	1999/06/08 07:06:47
*************** fix = {
*** 136,141 ****
--- 136,153 ----
  
      sed = "/^[ ]*typedef[ \t][ \t]*unsigned char[ \t][ \t]*bool[ \t]*;/a\\\n"
                  "#endif\n";
+ 
+     sed = "/^typedef[ \t][ \t]*int[ \t][ \t]*bool[ \t]*;/i\\\n"
+                 "#ifndef __cplusplus\n";
+ 
+     sed = "/^typedef[ \t][ \t]*int[ \t][ \t]*bool[ \t]*;/a\\\n"
+                 "#endif\n";
+ 
+     sed = "/^[ ]*typedef[ \t][ \t]*unsigned int[ \t][ \t]*bool[ \t]*;/i\\\n"
+                 "#ifndef __cplusplus\n";
+ 
+     sed = "/^[ ]*typedef[ \t][ \t]*unsigned int[ \t][ \t]*bool[ \t]*;/a\\\n"
+                 "#endif\n";
  };
  
  




More information about the Gcc-patches mailing list