This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Disallow GIMME in ext/
[perl5.git] / op.h
diff --git a/op.h b/op.h
index 9e60beb..a84a02b 100644 (file)
--- a/op.h
+++ b/op.h
@@ -109,6 +109,7 @@ Deprecated.  Use C<GIMME_V> instead.
                                /*  On control verbs, we saw no label */
                                /*  On flipflop, we saw ... instead of .. */
                                /*  On UNOPs, saw bare parens, e.g. eof(). */
+                               /*  On OP_CHDIR, handle (or bare parens) */
                                /*  On OP_NULL, saw a "do". */
                                /*  On OP_EXISTS, treat av as av, not avhv.  */
                                /*  On OP_(ENTER|LEAVE)EVAL, don't clear $@ */
@@ -149,12 +150,14 @@ Deprecated.  Use C<GIMME_V> instead.
 #define OPf_LIST       OPf_WANT_LIST
 #define OPf_KNOW       OPf_WANT
 
-#define GIMME \
+#if !defined(PERL_CORE) && !defined(PERL_EXT)
+#  define GIMME \
          (PL_op->op_flags & OPf_WANT                                   \
           ? ((PL_op->op_flags & OPf_WANT) == OPf_WANT_LIST             \
              ? G_ARRAY                                                 \
              : G_SCALAR)                                               \
           : dowantarray())
+#endif
 
 
 /* NOTE: OPp* flags are now auto-generated and defined in opcode.h,
@@ -923,13 +926,13 @@ is also available as well as C<OP_TYPE_IS_OR_WAS_NN>
 and C<OP_TYPE_ISNT_AND_WASNT_NN> which elide
 the NULL pointer check.
 
-=for apidoc Am|bool|OP_HAS_SIBLING|OP *o
+=for apidoc Am|bool|OpHAS_SIBLING|OP *o
 Returns true if o has a sibling
 
-=for apidoc Am|bool|OP_SIBLING|OP *o
+=for apidoc Am|bool|OpSIBLING|OP *o
 Returns the sibling of o, or NULL if there is no sibling
 
-=for apidoc Am|bool|OP_SIBLING_set|OP *o|OP *sib
+=for apidoc Am|bool|OpSIBLING_set|OP *o|OP *sib
 Sets the sibling of o to sib
 
 =cut
@@ -969,13 +972,16 @@ Sets the sibling of o to sib
     ( (o) && OP_TYPE_ISNT_AND_WASNT_NN(o, type) )
 
 #ifdef PERL_OP_PARENT
-#  define OP_HAS_SIBLING(o)      (!cBOOL((o)->op_lastsib))
-#  define OP_SIBLING(o)          (0 + (o)->op_lastsib ? NULL : (o)->op_sibling)
-#  define OP_SIBLING_set(o, sib) ((o)->op_sibling = (sib))
+#  define OpHAS_SIBLING(o)     (!cBOOL((o)->op_lastsib))
+#  define OpSIBLING(o)         (0 + (o)->op_lastsib ? NULL : (o)->op_sibling)
+#  define OpSIBLING_set(o, sib)        ((o)->op_sibling = (sib))
 #else
-#  define OP_HAS_SIBLING(o)      (cBOOL((o)->op_sibling))
-#  define OP_SIBLING(o)          (0 + (o)->op_sibling)
-#  define OP_SIBLING_set(o, sib) ((o)->op_sibling = (sib))
+#  define OpHAS_SIBLING(o)     (cBOOL((o)->op_sibling))
+#  define OpSIBLING(o)         (0 + (o)->op_sibling)
+#  define OpSIBLING_set(o, sib)        ((o)->op_sibling = (sib))
+#endif
+#if !defined(PERL_CORE) && !defined(PERL_EXT)
+#  define OP_SIBLING(o)                OpSIBLING(o)
 #endif
 
 #define newATTRSUB(f, o, p, a, b) Perl_newATTRSUB_x(aTHX_  f, o, p, a, b, FALSE)