summaryrefslogtreecommitdiff
path: root/mg.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-08 16:02:54 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-08 16:02:54 +0000
commit01b8bcb77a033a072e6afd95c46cef74d30628c1 (patch)
tree7ebc9cf04300d652126af3bdb51e2c28e8e9884e /mg.h
parent8b6b16e72bf4dd30bd09781ad50e9f66fd94440b (diff)
downloadperl-01b8bcb77a033a072e6afd95c46cef74d30628c1.tar.gz
Add and use MgPV_nolen_const
p4raw-id: //depot/perl@24761
Diffstat (limited to 'mg.h')
-rw-r--r--mg.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/mg.h b/mg.h
index f07c248f24..8f5644bff6 100644
--- a/mg.h
+++ b/mg.h
@@ -48,8 +48,11 @@ 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) : \
+#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 MgPV_nolen_const(mg) (((((int)(mg)->mg_len)) == HEf_SVKEY) ? \
+ SvPV_nolen_const((SV*)((mg)->mg_ptr)) : \
(const char*)(mg)->mg_ptr)
#define SvTIED_mg(sv,how) \