[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more Perl ... fun
On Fri, Nov 08, 2002 at 05:22:33PM +1100, Peter Zelezny wrote:
> On Fri, 8 Nov 2002 05:52:06 +0000
> Lloyd Williams <binary_frog@chatcircuit.com> wrote:
>
> > Ah, I think this is it. perl 5.8's XSUB.h defines readdir to
> > PerlDir_read. If you create a my_readdir function to wrap around
> > readdir before the perl includes, and call that instead of readdir, it
> > doesn't segfault. If you call perl_init before the readdir in
> > perl_auto_load, it doesn't segfault. This bug seems to be perl's
> > fault.
>
> iperlsys.h:#define PerlDir_read(dir) readdir((dir))
> XSUB.h:# define readdir PerlDir_read
>
> Makes you wonder... Those perl headers really are macro hell.
>
> I've settled on the attached patch. Can someone confirm that it compiles
> and runs with perl 5.8.x?
If somebody wants to fix it properly, as a general rule, you shouldn't
be using XSUB.h in something that isn't pure XSUB. Or, put
differently, you shouldn't mix XSUB code and C code - otherwise stuff
like this will happen. A brief glance at that source file indicates it
should probably be split into two.
--
.''`. ** Debian GNU/Linux ** | Andrew Suffield
: :' : http://www.debian.org/ | Dept. of Computing,
`. `' | Imperial College,
`- -><- | London, UK
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/