sv.h: Add HvAMAGIC macros
authorFather Chrysostomos <sprout@cpan.org>
Fri, 18 May 2012 16:20:32 +0000 (09:20 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 22 May 2012 01:09:25 +0000 (18:09 -0700)
These are the only Hv* macros in sv.h, so I may be putting them in the
wrong place.  However, they are very closely related to those that
immediately precede them.

sv.h

diff --git a/sv.h b/sv.h
index 35c5eda..c3e6c5a 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -902,6 +902,11 @@ in gv.h: */
            && (SvFLAGS(SvSTASH(SvRV(sv))) &= ~SVf_AMAGIC))
 #endif
 
+/* To be used on the stashes themselves: */
+#define HvAMAGIC(hv)           (SvFLAGS(hv) & SVf_AMAGIC)
+#define HvAMAGIC_on(hv)                (SvFLAGS(hv) |= SVf_AMAGIC)
+#define HvAMAGIC_off(hv)       (SvFLAGS(hv) &=~ SVf_AMAGIC)
+
 /*
 =for apidoc Am|U32|SvGAMAGIC|SV* sv