From: Perl 5 Porters <perl5-porters@africa.nicoh.com>
Date: Sun, 8 Sep 1996 00:55:02 +0000 (+0000)
Subject: perl 5.003_05: mg.h
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=99069129ae4c94e216ce7ad2899e8f92ff47b10c;p=p5sagit%2Fp5-mst-13.2.git

perl 5.003_05: mg.h

Replace the oft-repeated mg_ptr incantation with
the simple MgPVKEY macro.

Rename MgPVKEY to MgPV (to match with HePV elsewhere).  Add
additional parens around the "mg".
---

diff --git a/mg.h b/mg.h
index ab24eb0..8fbda82 100644
--- a/mg.h
+++ b/mg.h
@@ -34,3 +34,7 @@ struct magic {
 
 #define MgTAINTEDDIR(mg) (mg->mg_flags & MGf_TAINTEDDIR)
 #define MgTAINTEDDIR_on(mg) (mg->mg_flags |= MGf_TAINTEDDIR)
+
+#define MgPV(mg)                ((mg)->mg_len == HEf_SVKEY) ?   \
+                                SvPV((SV*)((mg)->mg_ptr),na) :   \
+                                (mg)->mg_ptr