Dual-Life / Devel-PPPort

Perl/Pollution/Portability
9 stars 28 forks source link

ppport.h NEED_SvRX and PERL_MAGIC_qr vs perl 5.6.0 #155

Closed kryde closed 4 years ago

kryde commented 4 years ago

With Devel::PPPort 3.52 ppport.h and my build of an i386 perl 5.6.0, a foo.xs file containing

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define NEED_SvRX
#include "ppport.h"

and which is unchanged to its generated foo.c, gets gets a compile error

ppport.h: In function 'DPPP_my_SvRX':
ppport.h:4045:28: error: 'PERL_MAGIC_qr' undeclared (first use in this function)
 4045 |    MAGIC *mg = mg_find(sv, PERL_MAGIC_qr);
      |                            ^~~~~~~~~~~~~

I see ppport.h has a #ifndef fallback for PERL_MAGIC_qr, but the DPPP_my_SvRX code is before there. Is it meant to be after?

(Presuming SvRX is in fact able to work at all in some fashion in 5.6.x, which I wasn't entirely sure of.)

khwilliamson commented 4 years ago

It's supposed to work in some fashion down to 5.3 actually. We'll look into it. @pali is this solution to this obvious to you?

pali commented 4 years ago

With Devel::PPPort 3.52 ppport.h

That is too old version. @kryde, please try again with new Devel::PPPort version from git, this problem with PERL_MAGIC_qr and SvRX should be already fixed.

khwilliamson commented 4 years ago

I didn't pay attention to version being used in this ticket. I just thought it must be from our brand new release, given the timing. Sorry.

kyrde, please let us know if the new release fixes this for you. I'll close this ticket in a week if I don't hear back from you

kryde commented 4 years ago

Oops, I missed 3.55 on cpan. Works for me. Thanks.