summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-16 23:03:42 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-16 23:03:42 +0000
commit1ccdb7301362000755034d5e6a7e73f566973104 (patch)
tree0fa142dae37f66fff801c799e2f2d0829fbdec0b /sv.h
parent2e5b91de24d62e1e2bf0fd32a1d4d1d849cafc82 (diff)
downloadperl-1ccdb7301362000755034d5e6a7e73f566973104.tar.gz
Add a new flag SVprv_PCS_IMPORTED (which is a pseudonym for SVf_SCREAM)
to note when a proxy constant subroutine is copied. This allows us to correctly set GvIMPORTED_CV_on() if the symbol is ever turned into a real GV. p4raw-id: //depot/perl@29566
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index a8e7a2ea13..9265197081 100644
--- a/sv.h
+++ b/sv.h
@@ -294,6 +294,10 @@ perform the upgrade if necessary. See C<svtype>.
#define SVp_SCREAM 0x00008000 /* has been studied? */
#define SVphv_CLONEABLE SVp_SCREAM /* PVHV (stashes) clone its objects */
#define SVpgv_GP SVp_SCREAM /* GV has a valid GP */
+#define SVprv_PCS_IMPORTED SVp_SCREAM /* RV is a proxy for a constant
+ subroutine in another package. Set the
+ CvIMPORTED_CV_ON() if it needs to be
+ expanded to a real GV */
#define SVs_PADSTALE 0x00010000 /* lexical has gone out of scope */
#define SVpad_STATE 0x00010000 /* pad name is a "state" var */
@@ -1013,6 +1017,11 @@ the scalar's value cannot change unless written to.
#define SvWEAKREF_on(sv) (SvFLAGS(sv) |= (SVf_ROK|SVprv_WEAKREF))
#define SvWEAKREF_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVprv_WEAKREF))
+#define SvPCS_IMPORTED(sv) ((SvFLAGS(sv) & (SVf_ROK|SVprv_PCS_IMPORTED)) \
+ == (SVf_ROK|SVprv_PCS_IMPORTED))
+#define SvPCS_IMPORTED_on(sv) (SvFLAGS(sv) |= (SVf_ROK|SVprv_PCS_IMPORTED))
+#define SvPCS_IMPORTED_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVprv_PCS_IMPORTED))
+
#define SvTHINKFIRST(sv) (SvFLAGS(sv) & SVf_THINKFIRST)
#define SvPADSTALE(sv) (SvFLAGS(sv) & SVs_PADSTALE)