This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin's GCC doesn't like this .sa_handler initialization for some reason


On 04/27/2010 03:05 AM, Corinna Vinschen wrote:
> Like this?  We are already using analog definitions in the socket header
> files.

Yes, that looks right.

> 
> Index: include/cygwin/signal.h
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/signal.h,v
> retrieving revision 1.18
> diff -u -p -r1.18 signal.h
> --- include/cygwin/signal.h	26 Feb 2010 05:43:50 -0000	1.18
> +++ include/cygwin/signal.h	27 Apr 2010 07:23:05 -0000
> @@ -194,14 +194,16 @@ typedef void (*_sig_func_ptr)(int);
>  
>  struct sigaction
>  {
> -  __extension__ union
> +  union
>    {
>      _sig_func_ptr sa_handler;  		/* SIG_DFL, SIG_IGN, or pointer to a function */
>      void  (*sa_sigaction) ( int, siginfo_t *, void * );
> -  };
> +  } __sighandler_or_action;
>    sigset_t sa_mask;
>    int sa_flags;
>  };
> +#define sa_handler	__sighandler_or_action.sa_handler
> +#define sa_sigaction	__sighandler_or_action.sa_sigaction

And while we're touching the file, we probably want to do similar
treatment for struct siginfo_t: si_tid, si_overrun, si_sigval, si_value,
si_status, si_utime, si_stime, and si_addr.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]