This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [RFC][patch] cygwin/singal.h is not compatible with -std=c89 or -std=c99
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 27 Nov 2006 09:33:41 +0100
- Subject: Re: [RFC][patch] cygwin/singal.h is not compatible with -std=c89 or -std=c99
- References: <4568655E.6030403@sh.cvut.cz>
- Reply-to: cygwin-patches at cygwin dot com
On Nov 25 16:46, V?clav Haisman wrote:
> [FreeBSD]
> struct sigaction {
> union {
> void (*__sa_handler)(int);
> void (*__sa_sigaction)(int, struct __siginfo *, void *);
> } __sigaction_u; /* signal handler */
> int sa_flags; /* see signal options below */
> sigset_t sa_mask; /* signal mask to apply */
> };
>
> #define sa_handler __sigaction_u.__sa_handler
>
> So, the attached patch is the minimal patch [...]
> struct sigaction
> {
> ! __extension__ union
> {
> _sig_func_ptr sa_handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
> void (*sa_sigaction) ( int, siginfo_t *, void * );
Thanks for the patch. Looking into this, I'd rather use the FreeBSD
approach, which is similary used in Linux. Please try the below patch.
Thanks,
Corinna
Index: include/cygwin/signal.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/signal.h,v
retrieving revision 1.14
diff -u -p -r1.14 signal.h
--- include/cygwin/signal.h 23 Mar 2006 15:55:59 -0000 1.14
+++ include/cygwin/signal.h 27 Nov 2006 08:32:52 -0000
@@ -198,10 +198,12 @@ struct sigaction
{
_sig_func_ptr sa_handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
void (*sa_sigaction) ( int, siginfo_t *, void * );
- };
+ } __sigaction_u;
sigset_t sa_mask;
int sa_flags;
};
+#define sa_handler __sigaction_u.sa_handler
+#define sa_sigaction __sigaction_u.sa_sigaction
#define SA_NOCLDSTOP 1 /* Do not generate SIGCHLD when children
stop */
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat