summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-24 11:52:28 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-24 11:52:28 +0000
commit035dab7448e2a9119f77775183b21181a53213a3 (patch)
tree17f1c958b3fa7526c2ae2bccccbf908f1e2aae68 /sv.h
parent6f58c29fcbfb50c3a72f7728b0d7c12ef3ba840c (diff)
downloadperl-035dab7448e2a9119f77775183b21181a53213a3.tar.gz
Replace usage of GvSTASH for storing the stash of C<our> with
OURSTASH. Set the stash with OURSTASH_SET. p4raw-id: //depot/perl@27306
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 5474074ed9..9e5ae2b2ca 100644
--- a/sv.h
+++ b/sv.h
@@ -937,6 +937,13 @@ in gv.h: */
((SvFLAGS(sv) & (SVpad_NAME|SVpad_OUR)) == (SVpad_NAME|SVpad_OUR))
#define SvPAD_OUR_on(sv) (SvFLAGS(sv) |= SVpad_NAME|SVpad_OUR)
+#define OURSTASH(sv) (SvPAD_OUR(sv) ? GvSTASH(sv) : NULL)
+#define OURSTASH_set(sv, st) \
+ STMT_START { \
+ assert(SvTYPE(sv) == SVt_PVGV); \
+ GvSTASH(sv) = st; \
+ } STMT_END
+
#ifdef PERL_DEBUG_COW
#define SvRV(sv) (0 + (sv)->sv_u.svu_rv)
#else