PATCH: fixincludes for wchar_t
Mark Mitchell
mark@codesourcery.com
Sat Nov 11 13:41:00 GMT 2000
Here's the fixincludes patch. This seems to work on Linux; Solaris
bootstrap starting now.
I broke protocol and did not fully bootstrap/test on Linux because the
tree is already broken for lots of people. I will, however, be doing
that in the background and will back out my change if anything goes
wrong.
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2000-11-11 Mark Mitchell <mark@codesourcery.com>
* fixinc/inclhack.def (avoid_wchar_t_type): New fix.
* fininc/fixincl.x: Regenerated.
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.93
diff -c -p -r1.93 inclhack.def
*** inclhack.def 2000/10/29 19:34:53 1.93
--- inclhack.def 2000/11/11 21:36:46
*************** fix = {
*** 769,774 ****
--- 769,790 ----
test_text = "typedef unsigned int\tbool \t; /* bool type */";
};
+ /*
+ * For C++, avoid any typedef definition of wchar_t,
+ * and use the built in type instead.
+ */
+
+ fix = {
+ hackname = avoid_wchar_t_type;
+
+ select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;";
+
+ c_fix = format;
+ c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
+ c_fix_arg = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;.*";
+
+ test_text = "typedef unsigned short\twchar_t \t; /* wchar_t type */";
+ };
/*
* Fix #defines under Alpha OSF/1:
More information about the Gcc-patches
mailing list