This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
VMS does have gai_strerror.
[perl5.git] / inline.h
index 18926d3..1abee4f 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -539,10 +539,12 @@ S_variant_under_utf8_count(const U8* const s, const U8* const e)
 
 #endif
 
-#undef PERL_WORDSIZE
-#undef PERL_COUNT_MULTIPLIER
-#undef PERL_WORD_BOUNDARY_MASK
-#undef PERL_VARIANTS_WORD_MASK
+#ifndef PERL_IN_REGEXEC_C   /* Keep  these around for that file */
+#  undef PERL_WORDSIZE
+#  undef PERL_COUNT_MULTIPLIER
+#  undef PERL_WORD_BOUNDARY_MASK
+#  undef PERL_VARIANTS_WORD_MASK
+#endif
 
 /*
 =for apidoc is_utf8_string
@@ -1813,17 +1815,6 @@ S_cx_pushloop_for(pTHX_ PERL_CONTEXT *cx, void *itervarp, SV* itersave)
 }
 
 
-PERL_STATIC_INLINE void
-S_cx_pushloop_given(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv)
-{
-    PERL_ARGS_ASSERT_CX_PUSHLOOP_GIVEN;
-
-    cx->blk_loop.my_op = cLOOP;
-    cx->blk_loop.itervar_u.gv = PL_defgv;
-    cx->blk_loop.itersave = orig_defsv;
-}
-
-
 /* pop all loop types, including plain */
 
 PERL_STATIC_INLINE void
@@ -1860,19 +1851,19 @@ S_cx_poploop(pTHX_ PERL_CONTEXT *cx)
 
 
 PERL_STATIC_INLINE void
-S_cx_pushwhereso(pTHX_ PERL_CONTEXT *cx)
+S_cx_pushwhen(pTHX_ PERL_CONTEXT *cx)
 {
-    PERL_ARGS_ASSERT_CX_PUSHWHERESO;
+    PERL_ARGS_ASSERT_CX_PUSHWHEN;
 
-    cx->blk_whereso.leave_op = cLOGOP->op_other;
+    cx->blk_givwhen.leave_op = cLOGOP->op_other;
 }
 
 
 PERL_STATIC_INLINE void
-S_cx_popwhereso(pTHX_ PERL_CONTEXT *cx)
+S_cx_popwhen(pTHX_ PERL_CONTEXT *cx)
 {
-    PERL_ARGS_ASSERT_CX_POPWHERESO;
-    assert(CxTYPE(cx) == CXt_WHERESO);
+    PERL_ARGS_ASSERT_CX_POPWHEN;
+    assert(CxTYPE(cx) == CXt_WHEN);
 
     PERL_UNUSED_ARG(cx);
     PERL_UNUSED_CONTEXT;
@@ -1880,6 +1871,30 @@ S_cx_popwhereso(pTHX_ PERL_CONTEXT *cx)
 }
 
 
+PERL_STATIC_INLINE void
+S_cx_pushgiven(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv)
+{
+    PERL_ARGS_ASSERT_CX_PUSHGIVEN;
+
+    cx->blk_givwhen.leave_op = cLOGOP->op_other;
+    cx->blk_givwhen.defsv_save = orig_defsv;
+}
+
+
+PERL_STATIC_INLINE void
+S_cx_popgiven(pTHX_ PERL_CONTEXT *cx)
+{
+    SV *sv;
+
+    PERL_ARGS_ASSERT_CX_POPGIVEN;
+    assert(CxTYPE(cx) == CXt_GIVEN);
+
+    sv = GvSV(PL_defgv);
+    GvSV(PL_defgv) = cx->blk_givwhen.defsv_save;
+    cx->blk_givwhen.defsv_save = NULL;
+    SvREFCNT_dec(sv);
+}
+
 /* ------------------ util.h ------------------------------------------- */
 
 /*