summaryrefslogtreecommitdiff
path: root/mg.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-07 18:32:44 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-07 18:32:44 +0000
commitfa28a6c6f7e8f9e40914ce7c0e4bd1cf2100f380 (patch)
tree0a9cffb0a55bdc08e3970e55925472227542947e /mg.h
parent832658c4bf34b93b5e24e5e1ff81cc2458c91a5c (diff)
downloadperl-fa28a6c6f7e8f9e40914ce7c0e4bd1cf2100f380.tar.gz
Add MgPV_const
p4raw-id: //depot/perl@24738
Diffstat (limited to 'mg.h')
-rw-r--r--mg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/mg.h b/mg.h
index 76903ca4a9..f07c248f24 100644
--- a/mg.h
+++ b/mg.h
@@ -48,6 +48,9 @@ struct magic {
#define MgPV(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \
SvPV((SV*)((mg)->mg_ptr),lp) : \
(mg)->mg_ptr)
+#define MgPV_const(mg,lp) ((((int)(lp = (mg)->mg_len)) == HEf_SVKEY) ? \
+ SvPV_const((SV*)((mg)->mg_ptr),lp) : \
+ (const char*)(mg)->mg_ptr)
#define SvTIED_mg(sv,how) \
(SvRMAGICAL(sv) ? mg_find((sv),(how)) : Null(MAGIC*))