diff options
author | David Mitchell <davem@iabyn.com> | 2010-07-18 18:18:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-07-18 18:39:18 +0100 |
commit | b3f91e9158d8a5c05627eba1c2848f35528571d2 (patch) | |
tree | 2a616b26bdf8d8d42ebdd6c8d05799853348c1e7 /cv.h | |
parent | c794ca97ff43be078aabf556aa282af208d9c38c (diff) | |
download | perl-b3f91e9158d8a5c05627eba1c2848f35528571d2.tar.gz |
add CvGV_set() macro and make CvGV() rvalue only
Now that CvGV can sometimes be reference counted, stop people from directly
assigning to it (by using CvGV as an lvalue), and instead force them to use
CvGV_set()
Diffstat (limited to 'cv.h')
-rw-r--r-- | cv.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -41,7 +41,8 @@ Returns the stash of the CV. #define CvROOT(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_root #define CvXSUB(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_xsub #define CvXSUBANY(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_xsubany -#define CvGV(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv +#define CvGV(sv) (0+((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv) +#define CvGV_set(cv,gv) Perl_cvgv_set(aTHX_ cv, gv) #define CvFILE(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_file #ifdef USE_ITHREADS # define CvFILE_set_from_cop(sv, cop) (CvFILE(sv) = savepv(CopFILE(cop))) |