This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fixincludes patch] Fix sys/signal.h on svr4 systems in regular fixincludes
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: bkorb at veritas dot com, gcc-patches at gcc dot gnu dot org
- Date: Sun, 24 Aug 2003 15:31:05 -0400
- Subject: [fixincludes patch] Fix sys/signal.h on svr4 systems in regular fixincludes
This does the right thing on Sequent's DYNIX/ptx, and fails to trigger on
Linux. OK for mainline?
* fixinc/inclhack.def (svr4_sighandler_type): New fix, ported
from fixinc.svr4.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/sys/signal.h: Regenerate.
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.173
diff -u -r1.173 inclhack.def
--- inclhack.def 24 Aug 2003 06:56:27 -0000 1.173
+++ inclhack.def 24 Aug 2003 19:29:38 -0000
@@ -2978,6 +2978,22 @@
};
#endif
+
+/*
+ * Correct types for signal handler constants like SIG_DFL; they might be
+ * void (*) (), and should be void (*) (int). C++ doesn't like the
+ * old style.
+ */
+fix = {
+ hackname = svr4_sighandler_type;
+ files = sys/signal.h;
+ select = 'void *\(\*\)\(\)';
+ c_fix = format;
+ c_fix_arg = "void (*)(int)";
+ test_text = "#define SIG_DFL (void(*)())0\n"
+ "#define SIG_IGN (void (*)())0\n";
+};
+
/*
* Put storage class at start of decl, to avoid warning.
*/
Index: tests/base/sys/signal.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/tests/base/sys/signal.h,v
retrieving revision 1.2
diff -u -r1.2 signal.h
--- tests/base/sys/signal.h 19 Jul 2000 14:18:31 -0000 1.2
+++ tests/base/sys/signal.h 24 Aug 2003 19:29:48 -0000
@@ -21,3 +21,10 @@
void (*signal())();
#endif
#endif /* SUN_SIGNAL_CHECK */
+
+
+#if defined( SVR4_SIGHANDLER_TYPE_CHECK )
+#define SIG_DFL (void (*)(int))0
+#define SIG_IGN (void (*)(int))0
+
+#endif /* SVR4_SIGHANDLER_TYPE_CHECK */
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html