summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-25 16:48:46 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-25 16:48:46 +0000
commit169d2d72355cfee106217aa142a9e61dc32e53d9 (patch)
tree9d3a981bdf184f258c8f9abe528a2f4cf7930ed3 /gv.h
parent584307902de552f84517013f42d1db478f4102bd (diff)
downloadperl-169d2d72355cfee106217aa142a9e61dc32e53d9.tar.gz
Abstract the specific use of SvCUR in GVs for detecting variables on
both sides of an assignment using GvASSIGN_GENERATION() and GvASSIGN_GENERATION_set(). p4raw-id: //depot/perl@27327
Diffstat (limited to 'gv.h')
-rw-r--r--gv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gv.h b/gv.h
index 3e2bc90d9a..81a42cfb2b 100644
--- a/gv.h
+++ b/gv.h
@@ -63,6 +63,11 @@ struct gp {
# define GvNAMELEN(gv) (GvXPVGV(gv)->xgv_namelen)
#endif
+#define GvASSIGN_GENERATION(gv) (0 + ((XPV*) SvANY(gv))->xpv_cur)
+#define GvASSIGN_GENERATION_set(gv,val) \
+ STMT_START { assert(SvTYPE(gv) == SVt_PVGV); \
+ (((XPV*) SvANY(gv))->xpv_cur = (val)); } STMT_END
+
/*
=head1 GV Functions