develooper Front page | perl.perl5.porters | Postings from July 2008

Re: [PATCH] ExtUtils::ParseXS - Error reporting problem with INTERFACE and ALIAS keywords

Thread Previous | Thread Next
Robert May
July 30, 2008 16:17
Re: [PATCH] ExtUtils::ParseXS - Error reporting problem with INTERFACE and ALIAS keywords
Message ID:
2008/5/22 Robert May <>:
> 2008/5/21 Nicholas Clark <>:
>> I've just added this function to blead:
>> void
>> Perl_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
>> {
> [snip]
>> }
>> I'd assume that it will appear in 5.8.9 and
>> 5.10.1, at which point ExtUtils::ParseXS could call it as is.
>> For everything else, I think it would be viable to patch
>> ExtUtils::ParseXS to see if it
>> needs it, and if so emit it as a static function.

> [snip]
> I could put together a patch for either, but probably not until
> sometime next week.

It's been a long week :-)

The attached patch modifies ExtUtils::ParseXS to always emit a static
version of Perl_croak_xs_usage.  The static version is protected by
pre-processor directives so that it is only compiled on perl versions
that do not have the function in core.  Macros ensure that the core or
static version get called as needed.

I had to change the HvNAME_get() call in the core function to HvNAME()
in the static one, in order to get it to compile back to 5.6.1

The patch also adds tests (and updates the MANIFEST).  The patch is
against blead@34160 - I could make it against the EX::PXS distribution
if that is preferred.

I've only tested this on MSWin32 (as that's all I have available) -
but I have used it with Perl 5.6.1, 5.8.8, 5.10.0 and bleed, with both
MSVC6 and gcc compilers in various combinations with nmake and dmake.

There is a problem that I haven't yet got to the bottom of with
compiling the new tests (XSUsage.xs) against 5.6.1.  It's something to
do with the INTERFACE keyword, but it's not a new problem: it exists
with the xsubpp distributed with 5.6.1, so the easiest thing to do is
probably to skip the new tests on perl 5.6.x and earlier.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About