more complete File::Spec support for Mac and VMS, tests (from
[p5sagit/p5-mst-13.2.git] / scope.h
diff --git a/scope.h b/scope.h
index 330467f..fa21199 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -30,6 +30,8 @@
 #define SAVEt_GENERIC_SVREF    29
 #define SAVEt_DESTRUCTOR_X     30
 #define SAVEt_VPTR             31
+#define SAVEt_I8               32
+#define SAVEt_COMPPAD          33
 
 #define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow()
 #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
 #define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr)
 #define SSPOPDXPTR (PL_savestack[--PL_savestack_ix].any_dxptr)
 
+/*
+=for apidoc Ams||SAVETMPS
+Opening bracket for temporaries on a callback.  See C<FREETMPS> and
+L<perlcall>.
+
+=for apidoc Ams||FREETMPS
+Closing bracket for temporaries on a callback.  See C<SAVETMPS> and
+L<perlcall>.
+
+=for apidoc Ams||ENTER
+Opening bracket on a callback.  See C<LEAVE> and L<perlcall>.
+
+=for apidoc Ams||LEAVE
+Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
+
+=cut
+*/
+
 #define SAVETMPS save_int((int*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix
 #define FREETMPS if (PL_tmps_ix > PL_tmps_floor) free_tmps()
 
@@ -71,6 +91,7 @@
  * Not using SOFT_CAST on SAVESPTR, SAVEGENERICSV and SAVEFREESV
  * because these are used for several kinds of pointer values
  */
+#define SAVEI8(i)      save_I8(SOFT_CAST(I8*)&(i))
 #define SAVEI16(i)     save_I16(SOFT_CAST(I16*)&(i))
 #define SAVEI32(i)     save_I32(SOFT_CAST(I32*)&(i))
 #define SAVEINT(i)     save_int(SOFT_CAST(int*)&(i))
        }                                       \
     } STMT_END
 
+#define SAVECOMPPAD() \
+    STMT_START {                                               \
+       if (PL_comppad && PL_curpad == AvARRAY(PL_comppad)) {   \
+           SSCHECK(2);                                         \
+           SSPUSHPTR((SV*)PL_comppad);                         \
+           SSPUSHINT(SAVEt_COMPPAD);                           \
+       }                                                       \
+       else {                                                  \
+           SAVEVPTR(PL_curpad);                                \
+           SAVESPTR(PL_comppad);                               \
+       }                                                       \
+    } STMT_END
+
 #ifdef USE_ITHREADS
 #  define SAVECOPSTASH(cop)    SAVEPPTR(CopSTASHPV(cop))
 #  define SAVECOPFILE(cop)     SAVEPPTR(CopFILE(cop))