From: Nicholas Clark Date: Sat, 5 May 2007 17:35:22 +0000 (+0000) Subject: Tweak change 30841 so that B works on maint too. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c1f70cbf29b1c0cfc4cf8a13260aa01453de093;p=p5sagit%2Fp5-mst-13.2.git Tweak change 30841 so that B works on maint too. p4raw-id: //depot/perl@31153 --- diff --git a/ext/B/B.xs b/ext/B/B.xs index c09ddc3..89ddf2b 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -990,6 +990,8 @@ LISTOP_children(o) # define PMOP_pmreplstart(o) o->op_pmstashstartu.op_pmreplstart #else # define PMOP_pmreplstart(o) o->op_pmreplstart +# define PMOP_pmpermflags(o) o->op_pmpermflags +# define PMOP_pmdynflags(o) o->op_pmdynflags #endif #define PMOP_pmnext(o) o->op_pmnext #define PMOP_pmregexp(o) PM_GETRE(o) @@ -1085,6 +1087,18 @@ U32 PMOP_pmflags(o) B::PMOP o +#if PERL_VERSION < 9 + +U32 +PMOP_pmpermflags(o) + B::PMOP o + +U8 +PMOP_pmdynflags(o) + B::PMOP o + +#endif + void PMOP_precomp(o) B::PMOP o @@ -1095,6 +1109,8 @@ PMOP_precomp(o) if (rx) sv_setpvn(ST(0), rx->precomp, rx->prelen); +#if PERL_VERSION >= 9 + void PMOP_reflags(o) B::PMOP o @@ -1105,6 +1121,8 @@ PMOP_reflags(o) if (rx) sv_setuv(ST(0), rx->extflags); +#endif + #define SVOP_sv(o) cSVOPo->op_sv #define SVOP_gv(o) ((GV*)cSVOPo->op_sv) diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index f663d35..0ef827c 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -19,8 +19,8 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring SVf_IOK SVf_NOK SVf_ROK SVf_POK SVpad_OUR SVf_FAKE SVs_RMG SVs_SMG CVf_METHOD CVf_LOCKED CVf_LVALUE CVf_ASSERTION PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE - PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED - RXf_SKIPWHITE); + PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED), + ($] < 5.009 ? 'PMf_SKIPWHITE' : 'RXf_SKIPWHITE'); $VERSION = 0.81; use strict; use vars qw/$AUTOLOAD/; @@ -4185,7 +4185,9 @@ sub pp_split { # handle special case of split(), and split(' ') that compiles to /\s+/ $kid = $op->first; - if ( $kid->flags & OPf_SPECIAL and $kid->reflags & RXf_SKIPWHITE ) { + if ( $kid->flags & OPf_SPECIAL + and ( $] < 5.009 ? $kid->pmflags & PMf_SKIPWHITE() + : $kid->reflags & RXf_SKIPWHITE() ) ) { $exprs[0] = "' '"; } diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index d2ff6b8..00be1b8 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -119,9 +119,9 @@ use Test::More tests => ( # per-pkg tests (function ct + require_ok) 40 + 16 # Data::Dumper, Digest::MD5 + 517 + 262 # B::Deparse, B + 595 + 190 # POSIX, IO::Socket - + 323 * ($] > 5.009) + + 345 * ($] > 5.009) + 17 * ($] >= 5.009003) - - 344); # fudge + - 366); # fudge require_ok("B::Concise"); @@ -176,10 +176,10 @@ my $testpkgs = { OPpSORT_REVERSE OPpTARGET_MY OPpTRANS_COMPLEMENT OPpTRANS_DELETE OPpTRANS_SQUASH PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_FOLD PMf_GLOBAL PMf_KEEP - PMf_MULTILINE PMf_ONCE PMf_SINGLELINE RXf_SKIPWHITE + PMf_MULTILINE PMf_ONCE PMf_SINGLELINE POSTFIX SVf_FAKE SVf_IOK SVf_NOK SVf_POK SVf_ROK SVpad_OUR SVs_RMG SVs_SMG SWAP_CHILDREN OPpPAD_STATE - /], + /, $] > 5.009 ? ('RXf_SKIPWHITE') : ('PMf_SKIPWHITE')], }, POSIX => { dflt => 'constant', # all but 252/589