This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove xcv_condp CV field which is no longer used.
[perl5.git] / pp.h
diff --git a/pp.h b/pp.h
index a3b9ac9..f15c6e7 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -1,16 +1,21 @@
 /*    pp.h
  *
- *    Copyright (c) 1991-1994, Larry Wall
+ *    Copyright (c) 1991-1997, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
  *
  */
 
+#ifdef USE_THREADS
+#define ARGS thr
+#define dARGS struct thread *thr;
+#define PP(s) OP* s(ARGS) dARGS
+#else
 #define ARGS
-#define ARGSproto void
 #define dARGS
 #define PP(s) OP* s(ARGS) dARGS
+#endif /* USE_THREADS */
 
 #define SP sp
 #define MARK mark
 #define POPp           (SvPVx(POPs, na))
 #define POPn           (SvNVx(POPs))
 #define POPi           ((IV)SvIVx(POPs))
-#define POPu           ((UV)SvIVx(POPs))
+#define POPu           ((UV)SvUVx(POPs))
 #define POPl           ((long)SvIVx(POPs))
 
 #define TOPs           (*sp)
 #define TOPp           (SvPV(TOPs, na))
 #define TOPn           (SvNV(TOPs))
 #define TOPi           ((IV)SvIV(TOPs))
-#define TOPu           ((UV)SvIV(TOPs))
+#define TOPu           ((UV)SvUV(TOPs))
 #define TOPl           ((long)SvIV(TOPs))
 
 /* Go to some pains in the rare event that we must extend the stack. */
 #define dTOPuv         UV value = TOPu
 #define dPOPuv         UV value = POPu
 
-#define dPOPPOPssrl    SV *right = POPs; SV *left = POPs
-#define dPOPPOPnnrl    double right = POPn; double left = POPn
-#define dPOPPOPiirl    IV right = POPi; IV left = POPi
-#define dPOPPOPuurl    UV right = POPu; UV left = POPu
-
-#define dPOPTOPssrl    SV *right = POPs; SV *left = TOPs
-#define dPOPTOPnnrl    double right = POPn; double left = TOPn
-#define dPOPTOPiirl    IV right = POPi; IV left = TOPi
-#define dPOPTOPuurl    UV right = POPu; UV left = TOPu
+#define dPOPXssrl(X)   SV *right = POPs; SV *left = CAT2(X,s)
+#define dPOPXnnrl(X)   double right = POPn; double left = CAT2(X,n)
+#define dPOPXiirl(X)   IV right = POPi; IV left = CAT2(X,i)
+
+#define USE_LEFT(sv) \
+       (SvOK(sv) || SvGMAGICAL(sv) || !(op->op_flags & OPf_STACKED))
+#define dPOPXnnrl_ul(X)        \
+    double right = POPn;                               \
+    SV *leftsv = CAT2(X,s);                            \
+    double left = USE_LEFT(leftsv) ? SvNV(leftsv) : 0.0
+#define dPOPXiirl_ul(X) \
+    IV right = POPi;                                   \
+    SV *leftsv = CAT2(X,s);                            \
+    IV left = USE_LEFT(leftsv) ? SvIV(leftsv) : 0
+
+#define dPOPPOPssrl    dPOPXssrl(POP)
+#define dPOPPOPnnrl    dPOPXnnrl(POP)
+#define dPOPPOPnnrl_ul dPOPXnnrl_ul(POP)
+#define dPOPPOPiirl    dPOPXiirl(POP)
+#define dPOPPOPiirl_ul dPOPXiirl_ul(POP)
+
+#define dPOPTOPssrl    dPOPXssrl(TOP)
+#define dPOPTOPnnrl    dPOPXnnrl(TOP)
+#define dPOPTOPnnrl_ul dPOPXnnrl_ul(TOP)
+#define dPOPTOPiirl    dPOPXiirl(TOP)
+#define dPOPTOPiirl_ul dPOPXiirl_ul(TOP)
 
 #define RETPUSHYES     RETURNX(PUSHs(&sv_yes))
 #define RETPUSHNO      RETURNX(PUSHs(&sv_no))