From: Nicholas Clark Date: Tue, 7 Jun 2005 18:33:08 +0000 (+0000) Subject: Add SvPV_nolen_const and SvPV_nomg_const X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ce348e89750366600d8292ab1f0f55948ddb66e;p=p5sagit%2Fp5-mst-13.2.git Add SvPV_nolen_const and SvPV_nomg_const p4raw-id: //depot/perl@24739 --- diff --git a/sv.h b/sv.h index 377f9a3..9993312 100644 --- a/sv.h +++ b/sv.h @@ -1224,7 +1224,12 @@ Like C but doesn't process magic. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC)) +#define SvPV_nolen_const(sv) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX_const(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC|SV_CONST_RETURN)) + #define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0) +#define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0) /* ----*/ @@ -1273,6 +1278,7 @@ Like C but doesn't process magic. # define SvNVx(sv) ({SV *_sv = (SV*)(sv); SvNV(_sv); }) # define SvPVx(sv, lp) ({SV *_sv = (sv); SvPV(_sv, lp); }) # define SvPVx_const(sv, lp) ({SV *_sv = (sv); SvPV_const(_sv, lp); }) +# define SvPVx_nolen_const(sv) ({SV *_sv = (sv); SvPV_nolen_const(_sv); }) # define SvPVutf8x(sv, lp) ({SV *_sv = (sv); SvPVutf8(_sv, lp); }) # define SvPVbytex(sv, lp) ({SV *_sv = (sv); SvPVbyte(_sv, lp); }) # define SvTRUE(sv) ( \