Skip processing a file if the file to be opened is '-'
[p5sagit/p5-mst-13.2.git] / cop.h
diff --git a/cop.h b/cop.h
index d5f7f42..88627d6 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -39,6 +39,10 @@ struct cop {
 #  define CopSTASH(c)          (CopSTASHPV(c) \
                                 ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
 #  define CopSTASH_set(c,hv)   CopSTASHPV_set(c, HvNAME(hv))
+#  define CopSTASH_eq(c,hv)    (hv                                     \
+                                && (CopSTASHPV(c) == HvNAME(hv)        \
+                                    || (CopSTASHPV(c) && HvNAME(hv)    \
+                                        && strEQ(CopSTASHPV(c), HvNAME(hv)))))
 #else
 #  define CopFILEGV(c)         ((c)->cop_filegv)
 #  define CopFILEGV_set(c,gv)  ((c)->cop_filegv = gv)
@@ -50,8 +54,10 @@ struct cop {
 #  define CopSTASH_set(c,hv)   ((c)->cop_stash = hv)
 #  define CopSTASHPV(c)                (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
 #  define CopSTASHPV_set(c,pv) CopSTASH_set(c, gv_stashpv(pv,GV_ADD))
+#  define CopSTASH_eq(c,hv)    (CopSTASH(c) == hv)
 #endif /* USE_ITHREADS */
 
+#define CopSTASH_ne(c,hv)      (!CopSTASH_eq(c,hv))
 #define CopLINE(c)             ((c)->cop_line)
 #define CopLINE_inc(c)         (++CopLINE(c))
 #define CopLINE_dec(c)         (--CopLINE(c))
@@ -364,7 +370,7 @@ struct stackinfo {
     I32                        si_type;        /* type of runlevel */
     struct stackinfo * si_prev;
     struct stackinfo * si_next;
-    I32 *              si_markbase;    /* where markstack begins for us.
+    I32                        si_markoff;     /* offset where markstack begins for us.
                                         * currently used only with DEBUGGING,
                                         * but not #ifdef-ed for bincompat */
 };
@@ -376,9 +382,10 @@ typedef struct stackinfo PERL_SI;
 #define cxstack_max    (PL_curstackinfo->si_cxmax)
 
 #ifdef DEBUGGING
-#  define      SET_MARKBASE PL_curstackinfo->si_markbase = PL_markstack_ptr
+#  define      SET_MARK_OFFSET \
+    PL_curstackinfo->si_markoff = PL_markstack_ptr - PL_markstack
 #else
-#  define      SET_MARKBASE NOOP
+#  define      SET_MARK_OFFSET NOOP
 #endif
 
 #define PUSHSTACKi(type) \
@@ -394,7 +401,7 @@ typedef struct stackinfo PERL_SI;
        AvFILLp(next->si_stack) = 0;                                    \
        SWITCHSTACK(PL_curstack,next->si_stack);                        \
        PL_curstackinfo = next;                                         \
-       SET_MARKBASE;                                                   \
+       SET_MARK_OFFSET;                                                \
     } STMT_END
 
 #define PUSHSTACK PUSHSTACKi(PERLSI_UNKNOWN)