Fix COPHH for PERL_BCDVERSION < 0x5013007
Tim Bunce [Thu, 4 Oct 2012 08:08:33 +0000 (09:08 +0100)]
SizeMe.xs

index 3c57790..ddef672 100644 (file)
--- a/SizeMe.xs
+++ b/SizeMe.xs
@@ -43,9 +43,6 @@
 #  define SvSHARED_HEK_FROM_PV(pvx) \
         ((struct hek*)(pvx - STRUCT_OFFSET(struct hek, hek_key)))
 #endif
-#ifndef CopHINTHASH_get
-#define CopHINTHASH_get(c)  ((COPHH*)((c)->cop_hints_hash))
-#endif
 #ifndef MUTABLE_AV
 #define MUTABLE_AV(p) ((AV*)p)
 #endif
@@ -952,7 +949,14 @@ op_size_class(pTHX_ const OP * const baseop, opclass op_class, bool skip_op_stru
             sv_size(aTHX_ st, NPathLink("cop_stash"), (SV *)basecop->cop_stash, SOME_RECURSION);
          sv_size(aTHX_ st, NPathLink("cop_filegv"), (SV *)basecop->cop_filegv, SOME_RECURSION);
 #endif
+
 #if (PERL_BCDVERSION >= 0x5009004)
+#  if (PERL_BCDVERSION < 0x5013007)
+#    define COPHH struct refcounted_he
+#  endif
+#  ifndef CopHINTHASH_get
+#    define CopHINTHASH_get(c)  ((COPHH*)((c)->cop_hints_hash))
+#  endif
          refcounted_he_size(aTHX_ st, CopHINTHASH_get(basecop), NPathLink("cop_hints_hash"));
 #endif
         }