summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2002-03-23 22:27:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-23 21:44:23 +0000
commitbaca2b926d06af79ff324964e3a80ae62949176a (patch)
tree49cc156f72c64cf9963b9d6d9fd1fe1e09b28c7b
parent5de4e2bb0f891ff437cdcd5dfd502471bf3668f6 (diff)
downloadperl-baca2b926d06af79ff324964e3a80ae62949176a.tar.gz
tidy sv.[ch] after CRIPPLED_CC removal
Message-ID: <20020323222724.A19425@fdgroup.com> p4raw-id: //depot/perl@15452
-rw-r--r--embed.fnc6
-rw-r--r--embed.h6
-rw-r--r--global.sym3
-rw-r--r--pod/perlapi.pod43
-rw-r--r--proto.h6
-rw-r--r--sv.c61
-rw-r--r--sv.h180
7 files changed, 132 insertions, 173 deletions
diff --git a/embed.fnc b/embed.fnc
index 8e2070b7b7..ebebfc54ac 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -906,9 +906,9 @@ Ap |void |reginitcolors
Apd |char* |sv_2pv_nolen |SV* sv
Apd |char* |sv_2pvutf8_nolen|SV* sv
Apd |char* |sv_2pvbyte_nolen|SV* sv
-Apd |char* |sv_pv |SV *sv
-Apd |char* |sv_pvutf8 |SV *sv
-Apd |char* |sv_pvbyte |SV *sv
+Amd |char* |sv_pv |SV *sv
+Amd |char* |sv_pvutf8 |SV *sv
+Amd |char* |sv_pvbyte |SV *sv
Amd |STRLEN |sv_utf8_upgrade|SV *sv
ApdM |bool |sv_utf8_downgrade|SV *sv|bool fail_ok
Apd |void |sv_utf8_encode |SV *sv
diff --git a/embed.h b/embed.h
index 92debc8668..8dd9b60976 100644
--- a/embed.h
+++ b/embed.h
@@ -855,9 +855,6 @@
#define sv_2pv_nolen Perl_sv_2pv_nolen
#define sv_2pvutf8_nolen Perl_sv_2pvutf8_nolen
#define sv_2pvbyte_nolen Perl_sv_2pvbyte_nolen
-#define sv_pv Perl_sv_pv
-#define sv_pvutf8 Perl_sv_pvutf8
-#define sv_pvbyte Perl_sv_pvbyte
#define sv_utf8_downgrade Perl_sv_utf8_downgrade
#define sv_utf8_encode Perl_sv_utf8_encode
#define sv_utf8_decode Perl_sv_utf8_decode
@@ -2406,9 +2403,6 @@
#define sv_2pv_nolen(a) Perl_sv_2pv_nolen(aTHX_ a)
#define sv_2pvutf8_nolen(a) Perl_sv_2pvutf8_nolen(aTHX_ a)
#define sv_2pvbyte_nolen(a) Perl_sv_2pvbyte_nolen(aTHX_ a)
-#define sv_pv(a) Perl_sv_pv(aTHX_ a)
-#define sv_pvutf8(a) Perl_sv_pvutf8(aTHX_ a)
-#define sv_pvbyte(a) Perl_sv_pvbyte(aTHX_ a)
#define sv_utf8_downgrade(a,b) Perl_sv_utf8_downgrade(aTHX_ a,b)
#define sv_utf8_encode(a) Perl_sv_utf8_encode(aTHX_ a)
#define sv_utf8_decode(a) Perl_sv_utf8_decode(aTHX_ a)
diff --git a/global.sym b/global.sym
index d826bc6fc7..f86942ef7b 100644
--- a/global.sym
+++ b/global.sym
@@ -573,9 +573,6 @@ Perl_reginitcolors
Perl_sv_2pv_nolen
Perl_sv_2pvutf8_nolen
Perl_sv_2pvbyte_nolen
-Perl_sv_pv
-Perl_sv_pvutf8
-Perl_sv_pvbyte
Perl_sv_utf8_downgrade
Perl_sv_utf8_encode
Perl_sv_utf8_decode
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index 0a119452bf..ad0d6d850c 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -2584,22 +2584,22 @@ version which guarantees to evaluate sv only once.
=for hackers
Found in file sv.h
-=item SvIVX
+=item SvIVx
-Returns the raw value in the SV's IV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvIV()>.
+Coerces the given SV to an integer and returns it. Guarantees to evaluate
+sv only once. Use the more efficient C<SvIV> otherwise.
- IV SvIVX(SV* sv)
+ IV SvIVx(SV* sv)
=for hackers
Found in file sv.h
-=item SvIVx
+=item SvIVX
-Coerces the given SV to an integer and returns it. Guarantees to evaluate
-sv only once. Use the more efficient C<SvIV> otherwise.
+Returns the raw value in the SV's IV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvIV()>.
- IV SvIVx(SV* sv)
+ IV SvIVX(SV* sv)
=for hackers
Found in file sv.h
@@ -2699,22 +2699,22 @@ which guarantees to evaluate sv only once.
=for hackers
Found in file sv.h
-=item SvNVx
+=item SvNVX
-Coerces the given SV to a double and returns it. Guarantees to evaluate
-sv only once. Use the more efficient C<SvNV> otherwise.
+Returns the raw value in the SV's NV slot, without checks or conversions.
+Only use when you are sure SvNOK is true. See also C<SvNV()>.
- NV SvNVx(SV* sv)
+ NV SvNVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvNVX
+=item SvNVx
-Returns the raw value in the SV's NV slot, without checks or conversions.
-Only use when you are sure SvNOK is true. See also C<SvNV()>.
+Coerces the given SV to a double and returns it. Guarantees to evaluate
+sv only once. Use the more efficient C<SvNV> otherwise.
- NV SvNVX(SV* sv)
+ NV SvNVx(SV* sv)
=for hackers
Found in file sv.h
@@ -3832,8 +3832,7 @@ Found in file sv.c
=item sv_pv
-A private implementation of the C<SvPV_nolen> macro for compilers which can't
-cope with complex macro expressions. Always use the macro instead.
+Use the C<SvPV_nolen> macro instead
char* sv_pv(SV *sv)
@@ -3842,9 +3841,7 @@ Found in file sv.c
=item sv_pvbyte
-A private implementation of the C<SvPVbyte_nolen> macro for compilers
-which can't cope with complex macro expressions. Always use the macro
-instead.
+Use C<SvPVbyte_nolen> instead.
char* sv_pvbyte(SV *sv)
@@ -3910,9 +3907,7 @@ Found in file sv.c
=item sv_pvutf8
-A private implementation of the C<SvPVutf8_nolen> macro for compilers
-which can't cope with complex macro expressions. Always use the macro
-instead.
+Use the C<SvPVutf8_nolen> macro instead
char* sv_pvutf8(SV *sv)
diff --git a/proto.h b/proto.h
index 9fd88d3750..d3137e6013 100644
--- a/proto.h
+++ b/proto.h
@@ -954,9 +954,9 @@ PERL_CALLCONV void Perl_reginitcolors(pTHX);
PERL_CALLCONV char* Perl_sv_2pv_nolen(pTHX_ SV* sv);
PERL_CALLCONV char* Perl_sv_2pvutf8_nolen(pTHX_ SV* sv);
PERL_CALLCONV char* Perl_sv_2pvbyte_nolen(pTHX_ SV* sv);
-PERL_CALLCONV char* Perl_sv_pv(pTHX_ SV *sv);
-PERL_CALLCONV char* Perl_sv_pvutf8(pTHX_ SV *sv);
-PERL_CALLCONV char* Perl_sv_pvbyte(pTHX_ SV *sv);
+/* PERL_CALLCONV char* sv_pv(pTHX_ SV *sv); */
+/* PERL_CALLCONV char* sv_pvutf8(pTHX_ SV *sv); */
+/* PERL_CALLCONV char* sv_pvbyte(pTHX_ SV *sv); */
/* PERL_CALLCONV STRLEN sv_utf8_upgrade(pTHX_ SV *sv); */
PERL_CALLCONV bool Perl_sv_utf8_downgrade(pTHX_ SV *sv, bool fail_ok);
PERL_CALLCONV void Perl_sv_utf8_encode(pTHX_ SV *sv);
diff --git a/sv.c b/sv.c
index 4ea3936678..cd3b6e3da4 100644
--- a/sv.c
+++ b/sv.c
@@ -2875,8 +2875,8 @@ uiv_2buf(char *buf, IV iv, UV uv, int is_uv, char **peob)
return ptr;
}
-/* For backwards-compatibility only. sv_2pv() is normally #def'ed to
- * C<sv_2pv_macro()>. See also C<sv_2pv_flags()>.
+/* sv_2pv() is now a macro using Perl_sv_2pv_flags();
+ * this function provided for binary compatibility only
*/
char *
@@ -3322,6 +3322,11 @@ use the Encode extension for that.
=cut
*/
+/* sv_utf8_upgrade() is now a macro using sv_utf8_upgrade_flags();
+ * this function provided for binary compatibility only
+ */
+
+
STRLEN
Perl_sv_utf8_upgrade(pTHX_ register SV *sv)
{
@@ -3516,9 +3521,10 @@ C<SvSetMagicSV_nosteal>.
=cut
*/
-/* sv_setsv() is aliased to Perl_sv_setsv_macro; this function provided
- for binary compatibility only
-*/
+/* sv_setsv() is now a macro using Perl_sv_setsv_flags();
+ * this function provided for binary compatibility only
+ */
+
void
Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
{
@@ -4247,9 +4253,10 @@ Handles 'get' magic, but not 'set' magic. See C<sv_catpvn_mg>.
=cut
*/
-/* sv_catpvn() is aliased to Perl_sv_catpvn_macro; this function provided
- for binary compatibility only
-*/
+/* sv_catpvn() is now a macro using Perl_sv_catpvn_flags();
+ * this function provided for binary compatibility only
+ */
+
void
Perl_sv_catpvn(pTHX_ SV *dsv, const char* sstr, STRLEN slen)
{
@@ -4310,9 +4317,10 @@ not 'set' magic. See C<sv_catsv_mg>.
=cut */
-/* sv_catsv() is aliased to Perl_sv_catsv_macro; this function provided
- for binary compatibility only
-*/
+/* sv_catsv() is now a macro using Perl_sv_catsv_flags();
+ * this function provided for binary compatibility only
+ */
+
void
Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr)
{
@@ -6847,12 +6855,16 @@ Perl_sv_nv(pTHX_ register SV *sv)
/*
=for apidoc sv_pv
-A private implementation of the C<SvPV_nolen> macro for compilers which can't
-cope with complex macro expressions. Always use the macro instead.
+Use the C<SvPV_nolen> macro instead
=cut
*/
+/* sv_pv() is now a macro using SvPV_nolen();
+ * this function provided for binary compatibility only
+ */
+
+
char *
Perl_sv_pv(pTHX_ SV *sv)
{
@@ -6883,8 +6895,6 @@ Perl_sv_pvn(pTHX_ SV *sv, STRLEN *lp)
return sv_2pv(sv, lp);
}
-/* For -DCRIPPLED_CC only. See also C<sv_2pv_flags()>.
- */
char *
Perl_sv_pvn_nomg(pTHX_ register SV *sv, STRLEN *lp)
@@ -6906,6 +6916,10 @@ can't cope with complex macro expressions. Always use the macro instead.
=cut
*/
+/* sv_pvn_force() is now a macro using Perl_sv_pvn_force_flags();
+ * this function provided for binary compatibility only
+ */
+
char *
Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp)
{
@@ -6967,13 +6981,16 @@ Perl_sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
/*
=for apidoc sv_pvbyte
-A private implementation of the C<SvPVbyte_nolen> macro for compilers
-which can't cope with complex macro expressions. Always use the macro
-instead.
+Use C<SvPVbyte_nolen> instead.
=cut
*/
+/* sv_pvbyte () is now a macro using Perl_sv_2pv_flags();
+ * this function provided for binary compatibility only
+ */
+
+
char *
Perl_sv_pvbyte(pTHX_ SV *sv)
{
@@ -7018,12 +7035,14 @@ Perl_sv_pvbyten_force(pTHX_ SV *sv, STRLEN *lp)
/*
=for apidoc sv_pvutf8
-A private implementation of the C<SvPVutf8_nolen> macro for compilers
-which can't cope with complex macro expressions. Always use the macro
-instead.
+Use the C<SvPVutf8_nolen> macro instead
=cut
*/
+/* sv_pvutf8 () is now a macro using Perl_sv_2pv_flags();
+ * this function provided for binary compatibility only
+ */
+
char *
Perl_sv_pvutf8(pTHX_ SV *sv)
diff --git a/sv.h b/sv.h
index 9671bd7210..74c7f3c0c0 100644
--- a/sv.h
+++ b/sv.h
@@ -928,150 +928,75 @@ otherwise.
=cut
*/
-#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 SvPV_nomg(sv, lp) sv_pvn_nomg(sv, &lp)
-#define SvPV_force_flags(sv, lp, flags) sv_pvn_force_flags(sv, &lp, flags)
-
-#define SvPVutf8_force(sv, lp) sv_pvutf8n_force(sv, &lp)
-#define SvPVutf8(sv, lp) sv_pvutf8n(sv, &lp)
-#define SvPVutf8_nolen(sv) sv_pvutf8(sv)
-
-#define SvPVbyte_force(sv, lp) sv_pvbyte_force(sv, &lp)
-#define SvPVbyte(sv, lp) sv_pvbyten(sv, &lp)
-#define SvPVbyte_nolen(sv) sv_pvbyte(sv)
-
-#define SvPVx(sv, lp) sv_pvn(sv, &lp)
-#define SvPVx_force(sv, lp) sv_pvn_force(sv, &lp)
-#define SvPVutf8x(sv, lp) sv_pvutf8n(sv, &lp)
-#define SvPVutf8x_force(sv, lp) sv_pvutf8n_force(sv, &lp)
-#define SvPVbytex(sv, lp) sv_pvbyten(sv, &lp)
-#define SvPVbytex_force(sv, lp) sv_pvbyten_force(sv, &lp)
-
-#define SvIVx(sv) sv_iv(sv)
-#define SvUVx(sv) sv_uv(sv)
-#define SvNVx(sv) sv_nv(sv)
-
-#define SvTRUEx(sv) sv_true(sv)
-
-#define SvIV(sv) SvIVx(sv)
-#define SvNV(sv) SvNVx(sv)
-#define SvUV(sv) SvUVx(sv)
-#define SvTRUE(sv) SvTRUEx(sv)
-
-/* flag values for sv_*_flags functions */
-#define SV_IMMEDIATE_UNREF 1
-#define SV_GMAGIC 2
-
-#define sv_pvn_force_nomg(sv, lp) sv_pvn_force_flags(sv, lp, 0)
-#define sv_utf8_upgrade_nomg(sv) sv_utf8_upgrade_flags(sv, 0)
-#define sv_catpvn_nomg(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, 0)
-
-/* #ifndef CRIPPLED_CC */
-/* redefine some things to more efficient inlined versions */
-
/* Let us hope that bitmaps for UV and IV are the same */
-#undef SvIV
#define SvIV(sv) (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv))
-
-#undef SvUV
#define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
-
-#undef SvNV
#define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv))
-#define sv_setsv(dsv, ssv) sv_setsv_flags(dsv, ssv, SV_GMAGIC)
-#define sv_setsv_nomg(dsv, ssv) sv_setsv_flags(dsv, ssv, 0)
-#define sv_catsv(dsv, ssv) sv_catsv_flags(dsv, ssv, SV_GMAGIC)
-#define sv_catsv_nomg(dsv, ssv) sv_catsv_flags(dsv, ssv, 0)
-#define sv_catpvn(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, SV_GMAGIC)
-#define sv_2pv(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)
-#define sv_2pv_nomg(sv, lp) sv_2pv_flags(sv, lp, 0)
-#define sv_pvn_force(sv, lp) sv_pvn_force_flags(sv, lp, SV_GMAGIC)
-#define sv_utf8_upgrade(sv) sv_utf8_upgrade_flags(sv, SV_GMAGIC)
+/* ----*/
-#undef SvPV
#define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC)
-#undef SvPV_nomg
-#define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
-
-#undef SvPV_flags
#define SvPV_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
-#undef SvPV_force
#define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
-#undef SvPV_force_nomg
+
#define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
-#undef SvPV_force_flags
#define SvPV_force_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
-#undef SvPV_nolen
#define SvPV_nolen(sv) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? SvPVX(sv) : sv_2pv_nolen(sv))
-#undef SvPVutf8
-#define SvPVutf8(sv, lp) \
- ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8) \
- ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvutf8(sv, &lp))
-
-#undef SvPVutf8_force
-#define SvPVutf8_force(sv, lp) \
- ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == (SVf_POK|SVf_UTF8) \
- ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvutf8n_force(sv, &lp))
+#define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
-#undef SvPVutf8_nolen
-#define SvPVutf8_nolen(sv) \
- ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8)\
- ? SvPVX(sv) : sv_2pvutf8_nolen(sv))
+/* ----*/
-#undef SvPVutf8
#define SvPVutf8(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvutf8(sv, &lp))
-#undef SvPVutf8_force
#define SvPVutf8_force(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == (SVf_POK|SVf_UTF8) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvutf8n_force(sv, &lp))
-#undef SvPVutf8_nolen
+
#define SvPVutf8_nolen(sv) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK|SVf_UTF8)\
? SvPVX(sv) : sv_2pvutf8_nolen(sv))
-#undef SvPVbyte
+/* ----*/
+
#define SvPVbyte(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
-#undef SvPVbyte_force
#define SvPVbyte_force(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8|SVf_THINKFIRST)) == (SVf_POK) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvbyte_force(sv, &lp))
-#undef SvPVbyte_nolen
#define SvPVbyte_nolen(sv) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK)\
? SvPVX(sv) : sv_2pvbyte_nolen(sv))
+
+/* define FOOx(): idempotent versions of FOO(). If possible, use a local
+ * var to evaluate the arg once; failing that, use a global if possible;
+ * failing that, call a function to do the work
+ */
+
+#define SvPVx_force(sv, lp) sv_pvn_force(sv, &lp)
+#define SvPVutf8x_force(sv, lp) sv_pvutf8n_force(sv, &lp)
+#define SvPVbytex_force(sv, lp) sv_pvbyten_force(sv, &lp)
+
#ifdef __GNUC__
-# undef SvIVx
-# undef SvUVx
-# undef SvNVx
-# undef SvPVx
-# undef SvPVutf8x
-# undef SvPVbytex
-# undef SvTRUE
-# undef SvTRUEx
+
# define SvIVx(sv) ({SV *nsv = (SV*)(sv); SvIV(nsv); })
# define SvUVx(sv) ({SV *nsv = (SV*)(sv); SvUV(nsv); })
# define SvNVx(sv) ({SV *nsv = (SV*)(sv); SvNV(nsv); })
@@ -1095,26 +1020,31 @@ otherwise.
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
# define SvTRUEx(sv) ({SV *nsv = (sv); SvTRUE(nsv); })
+
#else /* __GNUC__ */
-#ifndef USE_5005THREADS
+
+# ifdef USE_5005THREADS
+# define SvIVx(sv) sv_iv(sv)
+# define SvUVx(sv) sv_uv(sv)
+# define SvNVx(sv) sv_nv(sv)
+# define SvPVx(sv, lp) sv_pvn(sv, &lp)
+# define SvPVutf8x(sv, lp) sv_pvutf8n(sv, &lp)
+# define SvPVbytex(sv, lp) sv_pvbyten(sv, &lp)
+# define SvTRUE(sv) SvTRUEx(sv)
+# define SvTRUEx(sv) sv_true(sv)
+
+# else /* USE_5005THREADS */
+
/* These inlined macros use globals, which will require a thread
* declaration in user code, so we avoid them under threads */
-# undef SvIVx
-# undef SvUVx
-# undef SvNVx
-# undef SvPVx
-# undef SvPVutf8x
-# undef SvPVbytex
-# undef SvTRUE
-# undef SvTRUEx
-# define SvIVx(sv) ((PL_Sv = (sv)), SvIV(PL_Sv))
-# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
-# define SvNVx(sv) ((PL_Sv = (sv)), SvNV(PL_Sv))
-# define SvPVx(sv, lp) ((PL_Sv = (sv)), SvPV(PL_Sv, lp))
-# define SvPVutf8x(sv, lp) ((PL_Sv = (sv)), SvPVutf8(PL_Sv, lp))
-# define SvPVbytex(sv, lp) ((PL_Sv = (sv)), SvPVbyte(PL_Sv, lp))
-# define SvTRUE(sv) ( \
+# define SvIVx(sv) ((PL_Sv = (sv)), SvIV(PL_Sv))
+# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
+# define SvNVx(sv) ((PL_Sv = (sv)), SvNV(PL_Sv))
+# define SvPVx(sv, lp) ((PL_Sv = (sv)), SvPV(PL_Sv, lp))
+# define SvPVutf8x(sv, lp) ((PL_Sv = (sv)), SvPVutf8(PL_Sv, lp))
+# define SvPVbytex(sv, lp) ((PL_Sv = (sv)), SvPVbyte(PL_Sv, lp))
+# define SvTRUE(sv) ( \
!sv \
? 0 \
: SvPOK(sv) \
@@ -1129,10 +1059,34 @@ otherwise.
: SvNOK(sv) \
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
-# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
-#endif /* !USE_5005THREADS */
-#endif /* !__GNU__ */
-/* #endif !CRIPPLED_CC */
+# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
+# endif /* USE_5005THREADS */
+#endif /* __GNU__ */
+
+
+/* flag values for sv_*_flags functions */
+#define SV_IMMEDIATE_UNREF 1
+#define SV_GMAGIC 2
+
+/* all these 'functions' are now just macros */
+
+#define sv_pv(sv) SvPV_nolen(sv)
+#define sv_pvutf8(sv) SvPVutf8_nolen(sv)
+#define sv_pvbyte(sv) SvPVbyte_nolen(sv)
+
+#define sv_pvn_force_nomg(sv, lp) sv_pvn_force_flags(sv, lp, 0)
+#define sv_utf8_upgrade_nomg(sv) sv_utf8_upgrade_flags(sv, 0)
+#define sv_catpvn_nomg(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, 0)
+#define sv_setsv(dsv, ssv) sv_setsv_flags(dsv, ssv, SV_GMAGIC)
+#define sv_setsv_nomg(dsv, ssv) sv_setsv_flags(dsv, ssv, 0)
+#define sv_catsv(dsv, ssv) sv_catsv_flags(dsv, ssv, SV_GMAGIC)
+#define sv_catsv_nomg(dsv, ssv) sv_catsv_flags(dsv, ssv, 0)
+#define sv_catpvn(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, SV_GMAGIC)
+#define sv_2pv(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)
+#define sv_2pv_nomg(sv, lp) sv_2pv_flags(sv, lp, 0)
+#define sv_pvn_force(sv, lp) sv_pvn_force_flags(sv, lp, SV_GMAGIC)
+#define sv_utf8_upgrade(sv) sv_utf8_upgrade_flags(sv, SV_GMAGIC)
+
/*
=for apidoc Am|SV*|newRV_inc|SV* sv