[patch] PR 30058, inline fixincludes for NetBSD

Krister Walfridsson cato@df.lth.se
Sun Mar 18 21:16:00 GMT 2007


The attached patch fix the C99 inline lossage for NetBSD 3.x.

Additional patches are needed for NetBSD 4.x (and possibly NetBSD 2.x). 
I'll get back with that in a week or so.

Bootstrapped (with --enable-languages="c,c++,fortran,treelang" as I had
some unrelated problems with java) and tested on i386-unknown-netbsdelf3.1.

OK to commit?

    /Krister


2007-03-18  Krister Walfridsson  <cato@df.lth.se>

 	* inclhack.def (netbsd_c99_inline_1): New.
 	* fixincl.x: Regenerate.
 	* tests/base/signal.h: New.
-------------- next part --------------
Index: fixincludes/inclhack.def
===================================================================
--- fixincludes/inclhack.def	(revision 123035)
+++ fixincludes/inclhack.def	(working copy)
@@ -2552,6 +2552,22 @@
 
 
 /*
+ *  Some versions of NetBSD don't expect the C99 inline semantics.
+ */
+fix = {
+    hackname  = netbsd_c99_inline_1;
+    mach      = *-*-netbsd*;
+    files     = signal.h;
+    select    = "extern __inline int";
+
+    c_fix     = format;
+    c_fix_arg = "extern\n#ifdef __GNUC_STDC_INLINE__\n__attribute__((__gnu_inline__))\n#endif\n__inline int";
+
+    test_text = "extern __inline int\nsigaddset(sigset_t *set, int signo)\n{}";
+};
+
+
+/*
  * NetBSD has a semicolon after the ending '}' for some extern "C".
  */
 fix = {
Index: fixincludes/tests/base/signal.h
===================================================================
--- fixincludes/tests/base/signal.h	(revision 0)
+++ fixincludes/tests/base/signal.h	(revision 0)
@@ -0,0 +1,20 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/signal.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( NETBSD_C99_INLINE_1_CHECK )
+extern
+#ifdef __GNUC_STDC_INLINE__
+__attribute__((__gnu_inline__))
+#endif
+__inline int
+sigaddset(sigset_t *set, int signo)
+{}
+#endif  /* NETBSD_C99_INLINE_1_CHECK */


More information about the Gcc-patches mailing list