summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/cop.h b/cop.h
index 83c86980ba..626feee927 100644
--- a/cop.h
+++ b/cop.h
@@ -389,6 +389,7 @@ struct cop {
#ifdef USE_ITHREADS
char * cop_stashpv; /* package line was compiled in */
char * cop_file; /* file name the following line # is from */
+ U32 cop_stashflags; /* currently only SVf_UTF8 */
#else
HV * cop_stash; /* package line was compiled in */
GV * cop_filegv; /* file the following line # is from */
@@ -433,9 +434,20 @@ struct cop {
# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savesharedpv(pv))
# endif
-# define CopSTASH(c) (CopSTASHPV(c) \
- ? gv_stashpv(CopSTASHPV(c),GV_ADD) : NULL)
-# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME_get(hv) : NULL)
+# define CopSTASH_flags(c) ((c)->cop_stashflags)
+# define CopSTASH_flags_set(c,flags) ((c)->cop_stashflags = flags)
+
+# define CopSTASH(c) (CopSTASHPV(c) \
+ ? gv_stashpv(CopSTASHPV(c), \
+ GV_ADD|(CopSTASH_flags(c) \
+ ? CopSTASH_flags(c): 0 )) \
+ : NULL)
+# define CopSTASH_set(c,hv) (CopSTASHPV_set(c, (hv) ? HvNAME_get(hv) : NULL), \
+ CopSTASH_flags_set(c, \
+ ((hv) && HvNAME_HEK(hv) && \
+ HvNAMEUTF8(hv)) \
+ ? SVf_UTF8 \
+ : 0))
# define CopSTASH_eq(c,hv) ((hv) && stashpv_hvname_match(c,hv))
# ifdef NETWARE
# define CopSTASH_free(c) SAVECOPSTASH_FREE(c)