fixinc/inclhack.def (avoid_wchar_t_type): New fix
Bruce Korb
bkorb@cruzio.com
Sat Nov 11 16:16:00 GMT 2000
Hi Mark,
Most likely, somebody, somewhere is going to end the wchar_t typedef
line with an incomplete comment. The result will be that the
``#endif'' will be inside that comment. I recommend that you delete
the second `c_fix_arg' and let fixincl default to using the select
clause. That will put the comment on the end of the #endif line
where it will do no harm. :-)
+/*
+ * 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 */";
+};
More information about the Gcc-patches
mailing list