summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>1999-01-24 03:45:32 +0100
committerGurusamy Sarathy <gsar@cpan.org>1999-02-14 09:57:29 +0000
commit1fa8b10d8c0f0780dab42b408cc071b5f7ee992b (patch)
tree79dec658b5a91fedbc68e28af30e38f5bb86f7a5 /sv.h
parent4afa425f54235784726a05dc06169d071f280d7a (diff)
downloadperl-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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 456d01c562..71e8e55fb5 100644
--- a/sv.h
+++ b/sv.h
@@ -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