This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[inseparable changes from patch from perl5.003_18 to perl5.003_19]
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index 36fa72d..0186536 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -131,11 +131,6 @@ struct io {
 #define SVphv_SHAREKEYS 0x20000000     /* keys live on shared string table */
 #define SVphv_LAZYDEL  0x40000000      /* entry in xhv_eiter must be deleted */
 
-#ifdef OVERLOAD
-#define SVpgv_AM        0x40000000
-/* #define SVpgv_badAM     0x20000000 */
-#endif /* OVERLOAD */
-
 struct xrv {
     SV *       xrv_rv;         /* pointer to another SV */
 };
@@ -558,7 +553,15 @@ SV *newRV_noinc _((SV *));
 
 #define SvSETMAGIC(x) if (SvSMAGICAL(x)) mg_set(x)
 
-#define SvSetSV(dst,src) if (dst != src) sv_setsv(dst,src)
+#define SvSetSV(dst,src) if ((dst) != (src)) sv_setsv(dst,src)
+
+#define SvSetSV_nosteal(dst,src) \
+           if ((dst) != (src)) {                       \
+               U32 tMpF = SvFLAGS(src) & SVs_TEMP;     \
+               SvTEMP_off(src);                        \
+               sv_setsv(dst, src);                     \
+               SvFLAGS(src) |= tMpF;                   \
+           }
 
 #define SvPEEK(sv) sv_peek(sv)