From: Nicholas Clark Date: Tue, 7 Jun 2005 18:32:44 +0000 (+0000) Subject: Add MgPV_const X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa28a6c6f7e8f9e40914ce7c0e4bd1cf2100f380;p=p5sagit%2Fp5-mst-13.2.git Add MgPV_const p4raw-id: //depot/perl@24738 --- diff --git a/mg.h b/mg.h index 76903ca..f07c248 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*))