diff options
author | Jan Dubois <jand@activestate.com> | 1999-01-24 03:45:32 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-14 09:57:29 +0000 |
commit | 1fa8b10d8c0f0780dab42b408cc071b5f7ee992b (patch) | |
tree | 79dec658b5a91fedbc68e28af30e38f5bb86f7a5 /sv.h | |
parent | 4afa425f54235784726a05dc06169d071f280d7a (diff) | |
download | perl-1fa8b10d8c0f0780dab42b408cc071b5f7ee992b.tar.gz |
provide SvPV_nolen(sv) to avoid use of PL_na
Message-ID: <36bb7ada.68485547@smtp1.ibm.net>
Subject: [PATCH 5.005_54] _54 version of SvPV_nolen patch
p4raw-id: //depot/perl@2912
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -512,6 +512,7 @@ struct xpvio { #define SvPV_force(sv, lp) sv_pvn_force(sv, &lp) #define SvPV(sv, lp) sv_pvn(sv, &lp) +#define SvPV_nolen(sv) sv_pv(sv) #define SvIVx(sv) sv_iv(sv) #define SvUVx(sv) sv_uv(sv) #define SvNVx(sv) sv_nv(sv) @@ -545,6 +546,10 @@ struct xpvio { ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force(sv, &lp)) +#undef SvPV_nolen +#define SvPV_nolen(sv) \ + (SvPOK(sv) ? SvPVX(sv) : sv_2pv_nolen(sv)) + #ifdef __GNUC__ # undef SvIVx # undef SvUVx |