]> git.vpit.fr Git - perl/modules/Lexical-Types.git/commitdiff
Really be compatible with the OP_PARENT feature
authorVincent Pit <vince@profvince.com>
Fri, 6 Feb 2015 14:04:33 +0000 (15:04 +0100)
committerVincent Pit <vince@profvince.com>
Fri, 6 Feb 2015 14:04:33 +0000 (15:04 +0100)
OP_SIBLING() has been renamed to OpSIBLING() in perl 5.21.7.

Types.xs

index 0cff8fa6e90a930d94f37208b13c9859c4cd1742..43544760bdb2f4198ba4f7f20782294afc1f2f43 100644 (file)
--- a/Types.xs
+++ b/Types.xs
 # define HvNAMELEN_get(H) strlen(HvNAME_get(H))
 #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 SvREFCNT_inc_simple_void_NN
@@ -862,11 +866,11 @@ STATIC void lt_peep_rec(pTHX_ OP *o, ptable *seen) {
       * Moreover, for non-special padrange ops (i.e. that aren't for
       * my (...) = @_), the first original padxv is its sibling or nephew.
       */
-     OP *kid = OP_SIBLING(o);
+     OP *kid = OpSIBLING(o);
      if (kid->op_type == OP_NULL && kid->op_flags & OPf_KIDS) {
       kid = kUNOP->op_first;
       if (kid->op_type == OP_NULL)
-       kid = OP_SIBLING(kid);
+       kid = OpSIBLING(kid);
      }
      lt_maybe_padrange_setup(o, kid);
     }
@@ -881,7 +885,7 @@ STATIC void lt_peep_rec(pTHX_ OP *o, ptable *seen) {
                           && op->op_flags & OPf_SPECIAL) {
      const OP *start = cUNOPx(cBINOPo->op_last)->op_first;
      if (start->op_type == OP_PUSHMARK)
-      start = OP_SIBLING(start);
+      start = OpSIBLING(start);
      lt_maybe_padrange_setup(op, start);
     }
     break;