From: Vincent Pit Date: Fri, 6 Feb 2015 13:40:15 +0000 (+0100) Subject: Really be compatible with the OP_PARENT feature X-Git-Tag: rt100264~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=937a967ba2770bc092c0ddbbb68f288c4bca853f Really be compatible with the OP_PARENT feature OP_SIBLING() has been renamed to OpSIBLING() in perl 5.21.7. --- diff --git a/Upper.xs b/Upper.xs index 8b2e639..24f452d 100644 --- a/Upper.xs +++ b/Upper.xs @@ -197,8 +197,12 @@ STATIC U8 su_op_gimme_reverse(U8 gimme) { #define OP_GIMME_REVERSE(G) su_op_gimme_reverse(G) #endif -#ifndef OP_SIBLING -# define OP_SIBLING(O) ((O)->op_sibling) +#ifndef OpSIBLING +# ifdef OP_SIBLING +# define OpSIBLING(O) OP_SIBLING(O) +# else +# define OpSIBLING(O) ((O)->op_sibling) +# endif #endif #ifndef PERL_MAGIC_tied @@ -1405,7 +1409,7 @@ STATIC void su_uplevel_storage_delete(pTHX_ su_uplevel_ud *sud) { } STATIC int su_uplevel_goto_static(const OP *o) { - for (; o; o = OP_SIBLING(o)) { + for (; o; o = OpSIBLING(o)) { /* goto ops are unops with kids. */ if (!(o->op_flags & OPf_KIDS)) continue; @@ -2100,8 +2104,8 @@ STATIC I32 su_context_normalize_up(pTHX_ I32 cxix) { return cxix - 1; break; case CXt_SUBST: - if (cx->blk_oldcop && OP_SIBLING(cx->blk_oldcop) - && OP_SIBLING(cx->blk_oldcop)->op_type == OP_SUBST) + if (cx->blk_oldcop && OpSIBLING(cx->blk_oldcop) + && OpSIBLING(cx->blk_oldcop)->op_type == OP_SUBST) return cxix - 1; break; } @@ -2136,8 +2140,8 @@ STATIC I32 su_context_normalize_down(pTHX_ I32 cxix) { return cxix + 1; break; case CXt_SUBST: - if (next->blk_oldcop && OP_SIBLING(next->blk_oldcop) - && OP_SIBLING(next->blk_oldcop)->op_type == OP_SUBST) + if (next->blk_oldcop && OpSIBLING(next->blk_oldcop) + && OpSIBLING(next->blk_oldcop)->op_type == OP_SUBST) return cxix + 1; break; } @@ -2167,8 +2171,8 @@ STATIC I32 su_context_gimme(pTHX_ I32 cxix) { #endif case CXt_SUBST: { const COP *cop = cx->blk_oldcop; - if (cop && OP_SIBLING(cop)) { - switch (OP_SIBLING(cop)->op_flags & OPf_WANT) { + if (cop && OpSIBLING(cop)) { + switch (OpSIBLING(cop)->op_flags & OPf_WANT) { case OPf_WANT_VOID: return G_VOID; case OPf_WANT_SCALAR: