Marc Lehmann <[EMAIL PROTECTED]> writes:

> On Thu, Nov 01, 2007 at 09:32:35PM +0100, [EMAIL PROTECTED] wrote:
> > /usr/local/bin/perl5.6.2 /usr/perl5.6.2/lib/5.6.2/ExtUtils/xsubpp  -typemap 
> > /usr/perl5.6.2/lib/5.6.2/ExtUtils/typemap -typemap typemap  EV.xs > EV.xsc 
> > && mv EV.xsc EV.c
> > ccache cc -c  -Ilibev  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H 
> > -fno-strict-aliasing -I/usr/local/include -O2 -pipe    -DVERSION=\"0.1\"  
> > -DXS_VERSION=\"0.1\" -DPIC -fPIC 
> > "-I/usr/perl5.6.2/lib/5.6.2/amd64-freebsd/CORE"  -DEV_USE_MONOTONIC EV.c
> > In file included from EV.xs:10:
> > libev/ev.c:357: warning: static declaration of 'Perl_sighandler' follows 
> > non-static declaration
> > /usr/perl5.6.2/lib/5.6.2/amd64-freebsd/CORE/proto.h:699: warning: previous 
> > declaration of 'Perl_sighandler' was here
> > EV.xs: In function `sv_signum':
> > EV.xs:37: error: `SIG_SIZE' undeclared (first use in this function)
> > EV.xs:37: error: (Each undeclared identifier is reported only once
> > EV.xs:37: error: for each function it appears in.)
> > *** Error code 1
> 
> Hmm, I copied that code straight from perl, but I guess 5.6 had diferent
> code, or didn't bother to export this symbol to modules?
> 
> Sorry for bothering you so much, could you find out how to get perls SIG_SIZE
> in your version of perl?
> 
> (Background: I need it to convert signal names to numbers).
> 
> Also, the warnings are frightening, it seems that perl overrides sigaction
> with its own version or so. This doesn't happen here (with 5.8.9 to be), but
> namespace pollution is pretty common in earlier versions.
> 
> Of course, one could simply require 5.8, but I don't think EV needs any
> 5.8 features, so maybe it could be ported wiht some minimal loss.
> 

There's no SIG_SIZE in 5.6, I think because there's no need for it (no
safe signals, so saving signals does not seem to be necessary). Maybe
you can use NSIG from /usr/include/sys/signal.h? But unfortunately,
the number does not match exactly on this system:

#define NSIG            32      /* number of old signals (counting 0) */

#define SIG_SIZE 34                     /**/

SIG_SIZE includes the final NULL entry (according to the comment),
that explains one off. And the list of signals has one signal doubled,
that explains probably the other one:

#define SIG_NUM  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 6, 32, 0         /**/

Or just use a trick like

   int foo[] = { SIG_NUM };
   int sig_size = sizeof(foo);

(or similar, my C knowledge is leaky)

Regards,
        Slaven

-- 
Slaven Rezic - slaven <at> rezic <dot> de
    babybike - routeplanner for cyclists in Berlin
               handheld (e.g. Compaq iPAQ with Linux) version of bbbike
    http://bbbike.sourceforge.net

Reply via email to