summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-07-05 02:31:26 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-07-05 02:31:26 +0000
commite9905555f91f68a030263c4a82187c30e04a3aed (patch)
tree1c3656e5aa381d253f0cce47a420c71ad06ca41f
parentf12c70209e012fbc59a7f4c437dc47d352265aed (diff)
downloadperl-e9905555f91f68a030263c4a82187c30e04a3aed.tar.gz
perl 5.003_01: pp.h
Revise SETsv() and tryAMAGICun() macros Rename global symbol to eliminate collision with system header files
-rw-r--r--pp.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/pp.h b/pp.h
index 44a3ebeb72..7dc918c40d 100644
--- a/pp.h
+++ b/pp.h
@@ -93,10 +93,6 @@
#define SETn(n) STMT_START { sv_setnv(TARG, (double)(n)); SETTARG; } STMT_END
#define SETi(i) STMT_START { sv_setiv(TARG, (IV)(i)); SETTARG; } STMT_END
-#ifdef OVERLOAD
-#define SETsv(sv) STMT_START { sv_setsv(TARG, (sv)); SETTARG; } STMT_END
-#endif /* OVERLOAD */
-
#define dTOPss SV *sv = TOPs
#define dPOPss SV *sv = POPs
#define dTOPnv double value = TOPn
@@ -127,7 +123,7 @@
stack_base = AvARRAY(t); \
stack_max = stack_base + AvMAX(t); \
sp = stack_sp = stack_base + AvFILL(t); \
- stack = t;
+ curstack = t;
#ifdef OVERLOAD
@@ -169,10 +165,13 @@
} \
} STMT_END
-#define tryAMAGICun(meth) tryAMAGICunW(meth,SETsv)
+#define tryAMAGICun tryAMAGICunSET
#define tryAMAGICunSET(meth) tryAMAGICunW(meth,SETs)
#define opASSIGN (op->op_flags & OPf_STACKED)
+#define SETsv(sv) STMT_START { \
+ if (opASSIGN) { sv_setsv(TARG, (sv)); SETTARG; } \
+ else SETs(sv); } STMT_END
/* newSVsv does not behave as advertised, so we copy missing
* information by hand */