This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fixincludes patches] More work to make OpenBSD normal
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: bkorb at veritas dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jul 2003 21:58:41 -0400
- Subject: [fixincludes patches] More work to make OpenBSD normal
Bruce, here's a set of proposed fixincludes fixes. Still working toward
standardizing the OpenBSD fixincludes.
Two of these avoid bogus fixes.
The other one comments on an apparently correct fix, although I'm a little
surprised by it (is this fix no longer needed or something?)
* inclhack.def (alpha_sbrk): Note that OpenBSD needs this fix.
(avoid_wchar_t_type): Put __cplusplus bypass in (for OpenBSD).
(struct_sockaddr): Avoid "fixing" sockaddr_in (on OpenBSD).
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.161
diff -u -6 -r1.161 inclhack.def
--- inclhack.def 9 Jul 2003 21:08:20 -0000 1.161
+++ inclhack.def 12 Jul 2003 01:54:17 -0000
@@ -576,12 +576,13 @@
test_text = "#ifndef(__mips64) /* bogus */\nextern int foo;\n#endif";
};
/*
* Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
+ * And OpenBSD.
*/
fix = {
hackname = alpha_sbrk;
files = unistd.h;
select = "char[ \t]*\\*[\t ]*sbrk[ \t]*\\(";
c_fix = format;
@@ -641,12 +642,13 @@
fix = {
hackname = avoid_wchar_t_type;
select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;";
bypass = "we must use the C\\+\\+ compiler's type";
+ bypass = "__cplusplus";
bypass = "_LINUX_NLS_H";
bypass = "XFree86: xc/lib/X11/Xlib\\.h";
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
@@ -2469,18 +2471,22 @@
};
/*
* IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr
* in prototype without previous definition.
+ *
+ * Don't fix OpenBSD, which uses struct sockaddr_in prototyping the same
+ * function, and does define it.
*/
fix = {
hackname = struct_sockaddr;
files = rpc/auth.h;
- select = "^.*authdes_create.*struct sockaddr";
+ select = "^.*authdes_create.*struct sockaddr[^_]";
bypass = "<sys/socket\.h>";
+ bypass = "struct sockaddr;\n";
c_fix = format;
c_fix_arg = "struct sockaddr;\n%0";
test_text = "extern AUTH* authdes_create( struct sockaddr* );";
};
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html