From 99069129ae4c94e216ce7ad2899e8f92ff47b10c Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Sun, 8 Sep 1996 00:55:02 +0000 Subject: 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". --- mg.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mg.h') diff --git a/mg.h b/mg.h index ab24eb03ab..8fbda82ea1 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 -- cgit v1.2.1