summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-10-29 16:06:39 +0000
committerNicholas Clark <nick@ccl4.org>2005-10-29 16:06:39 +0000
commit0feed65a3b89b009c18025da638bc5d9cd03851d (patch)
tree56ec71ed67445752bd995b1bbf78ac683b2c895e /mathoms.c
parent2711d9fbc9d348da12bba04fd69c8ee78a0bb77a (diff)
downloadperl-0feed65a3b89b009c18025da638bc5d9cd03851d.tar.gz
All the private implementations of @foo for compilers that can't do
complex macro expansions became dead wood sometime around 5.7.3 (Don't tell Otava this) p4raw-id: //depot/perl@25882
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c133
1 files changed, 133 insertions, 0 deletions
diff --git a/mathoms.c b/mathoms.c
index 4f35282a84..29faf69a38 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -142,6 +142,97 @@ Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr)
sv_catsv_flags(dstr, sstr, SV_GMAGIC);
}
+/*
+=for apidoc sv_iv
+
+A private implementation of the C<SvIVx> macro for compilers which can't
+cope with complex macro expressions. Always use the macro instead.
+
+=cut
+*/
+
+IV
+Perl_sv_iv(pTHX_ register SV *sv)
+{
+ if (SvIOK(sv)) {
+ if (SvIsUV(sv))
+ return (IV)SvUVX(sv);
+ return SvIVX(sv);
+ }
+ return sv_2iv(sv);
+}
+
+/*
+=for apidoc sv_uv
+
+A private implementation of the C<SvUVx> macro for compilers which can't
+cope with complex macro expressions. Always use the macro instead.
+
+=cut
+*/
+
+UV
+Perl_sv_uv(pTHX_ register SV *sv)
+{
+ if (SvIOK(sv)) {
+ if (SvIsUV(sv))
+ return SvUVX(sv);
+ return (UV)SvIVX(sv);
+ }
+ return sv_2uv(sv);
+}
+
+/*
+=for apidoc sv_nv
+
+A private implementation of the C<SvNVx> macro for compilers which can't
+cope with complex macro expressions. Always use the macro instead.
+
+=cut
+*/
+
+NV
+Perl_sv_nv(pTHX_ register SV *sv)
+{
+ if (SvNOK(sv))
+ return SvNVX(sv);
+ return sv_2nv(sv);
+}
+
+/*
+=for apidoc sv_pv
+
+Use the C<SvPV_nolen> macro instead
+
+=for apidoc sv_pvn
+
+A private implementation of the C<SvPV> macro for compilers which can't
+cope with complex macro expressions. Always use the macro instead.
+
+=cut
+*/
+
+char *
+Perl_sv_pvn(pTHX_ SV *sv, STRLEN *lp)
+{
+ if (SvPOK(sv)) {
+ *lp = SvCUR(sv);
+ return SvPVX(sv);
+ }
+ return sv_2pv(sv, lp);
+}
+
+
+char *
+Perl_sv_pvn_nomg(pTHX_ register SV *sv, STRLEN *lp)
+{
+ if (SvPOK(sv)) {
+ *lp = SvCUR(sv);
+ return SvPVX(sv);
+ }
+ return sv_2pv_flags(sv, lp, 0);
+}
+
/* sv_pv() is now a macro using SvPV_nolen();
* this function provided for binary compatibility only
*/
@@ -176,6 +267,27 @@ Perl_sv_pvbyte(pTHX_ SV *sv)
return sv_pv(sv);
}
+/*
+=for apidoc sv_pvbyte
+
+Use C<SvPVbyte_nolen> instead.
+
+=for apidoc sv_pvbyten
+
+A private implementation of the C<SvPVbyte> macro for compilers
+which can't cope with complex macro expressions. Always use the macro
+instead.
+
+=cut
+*/
+
+char *
+Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *lp)
+{
+ sv_utf8_downgrade(sv,0);
+ return sv_pvn(sv,lp);
+}
+
/* sv_pvutf8 () is now a macro using Perl_sv_2pv_flags();
* this function provided for binary compatibility only
*/
@@ -187,6 +299,27 @@ Perl_sv_pvutf8(pTHX_ SV *sv)
return sv_pv(sv);
}
+/*
+=for apidoc sv_pvutf8
+
+Use the C<SvPVutf8_nolen> macro instead
+
+=for apidoc sv_pvutf8n
+
+A private implementation of the C<SvPVutf8> macro for compilers
+which can't cope with complex macro expressions. Always use the macro
+instead.
+
+=cut
+*/
+
+char *
+Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *lp)
+{
+ sv_utf8_upgrade(sv);
+ return sv_pvn(sv,lp);
+}
+
/* sv_utf8_upgrade() is now a macro using sv_utf8_upgrade_flags();
* this function provided for binary compatibility only
*/