#define Newxz(ptr, num, type) Newz(0, ptr, num, type)
#endif
-#ifndef HvNAMELEN
-#define HvNAMELEN(stash) strlen(HvNAME(stash))
+#ifndef HvNAMELEN_get
+#define HvNAMELEN_get(stash) strlen(HvNAME(stash))
#endif
#ifndef HvNAMEUTF8
#endif
#ifndef GvNAMEUTF8
+#ifdef GvNAME_HEK
+#define GvNAMEUTF8(stash) HEK_UTF8(GvNAME_HEK(gv))
+#else
#define GvNAMEUTF8(stash) 0
#endif
+#endif
#ifndef SV_CATUTF8
#define SV_CATUTF8 0
GV* oldgv = CvGV(cv);
HV* oldhv = GvSTASH(oldgv);
- SV* old_full_name = newSVpvn_flags(HvNAME(oldhv), HvNAMELEN(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0);
+ SV* old_full_name = newSVpvn_flags(HvNAME(oldhv), HvNAMELEN_get(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0);
sv_catpvn(old_full_name, "::", 2);
sv_catpvn_flags(old_full_name, GvNAME(oldgv), GvNAMELEN(oldgv), GvNAMEUTF8(oldgv) ? SV_CATUTF8 : SV_CATBYTES);
SvREFCNT_dec(old_full_name);
if (old_data && HeVAL(old_data)) {
- SV* new_full_name = newSVpvn_flags(HvNAME(stash), HvNAMELEN(stash), HvNAMEUTF8(stash) ? SVf_UTF8 : 0);
+ SV* new_full_name = newSVpvn_flags(HvNAME(stash), HvNAMELEN_get(stash), HvNAMEUTF8(stash) ? SVf_UTF8 : 0);
sv_catpvn(new_full_name, "::", 2);
sv_catpvn_flags(new_full_name, nameptr, s - nameptr, utf8flag ? SV_CATUTF8 : SV_CATBYTES);
SvREFCNT_inc(HeVAL(old_data));