summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-04 16:15:34 +0000
committerGisle Aas <gisle@activestate.com>2006-01-04 16:15:34 +0000
commit89529cee496f815eec2d49f2510449af5063ddd8 (patch)
treee06748af374c318d12651d338e657323af4a0ce7
parent91d456aef184ffc6173bca456cc087b98f0e0831 (diff)
downloadperl-89529cee496f815eec2d49f2510449af5063ddd8.tar.gz
Make the new STR_WITH_LEN() affected compile under -Dusethreads.
Can't use STR_WITH_LEN() as argument to a macro :-( p4raw-id: //depot/perl@26649
-rw-r--r--gv.c8
-rw-r--r--locale.c16
-rw-r--r--mg.c2
-rw-r--r--perl.c4
-rw-r--r--perlio.c2
-rw-r--r--pp_sys.c2
-rw-r--r--sv.c2
-rw-r--r--sv.h8
-rw-r--r--toke.c2
9 files changed, 24 insertions, 22 deletions
diff --git a/gv.c b/gv.c
index 02ac8511a7..a2301acc58 100644
--- a/gv.c
+++ b/gv.c
@@ -292,7 +292,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level)
/* UNIVERSAL methods should be callable without a stash */
if (!stash) {
level = -1; /* probably appropriate */
- if(!(stash = gv_stashpvn(STR_WITH_LEN("UNIVERSAL"), FALSE)))
+ if(!(stash = gv_stashpvs("UNIVERSAL", FALSE)))
return 0;
}
@@ -375,7 +375,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level)
/* if at top level, try UNIVERSAL */
if (level == 0 || level == -1) {
- HV* const lastchance = gv_stashpvn(STR_WITH_LEN("UNIVERSAL"), FALSE);
+ HV* const lastchance = gv_stashpvs("UNIVERSAL", FALSE);
if (lastchance) {
if ((gv = gv_fetchmeth(lastchance, name, len,
@@ -639,7 +639,7 @@ STATIC void
S_require_errno(pTHX_ GV *gv)
{
dVAR;
- HV* stash = gv_stashpvn(STR_WITH_LEN("Errno"), FALSE);
+ HV* stash = gv_stashpvs("Errno", FALSE);
if (!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
dSP;
@@ -650,7 +650,7 @@ S_require_errno(pTHX_ GV *gv)
newSVpvs("Errno"), Nullsv);
LEAVE;
SPAGAIN;
- stash = gv_stashpvn(STR_WITH_LEN("Errno"), FALSE);
+ stash = gv_stashpvs("Errno", FALSE);
if (!stash || !(gv_fetchmethod(stash, "TIEHASH")))
Perl_croak(aTHX_ "Can't use %%! because Errno.pm is not available");
}
diff --git a/locale.c b/locale.c
index 567a97aba0..1df95fba03 100644
--- a/locale.c
+++ b/locale.c
@@ -499,23 +499,23 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
codeset = nl_langinfo(CODESET);
#endif
if (codeset)
- utf8locale = (ibcmp(codeset, STR_WITH_LEN("UTF-8")) == 0 ||
- ibcmp(codeset, STR_WITH_LEN("UTF8") ) == 0);
+ utf8locale = (Perl_ibcmp(aTHX_ codeset, STR_WITH_LEN("UTF-8")) == 0 ||
+ Perl_ibcmp(aTHX_ codeset, STR_WITH_LEN("UTF8") ) == 0);
#if defined(USE_LOCALE)
else { /* nl_langinfo(CODESET) is supposed to correctly
* interpret the locale environment variables,
* but just in case it fails, let's do this manually. */
if (lang)
- utf8locale = (ibcmp(lang, STR_WITH_LEN("UTF-8")) == 0 ||
- ibcmp(lang, STR_WITH_LEN("UTF8") ) == 0);
+ utf8locale = (Perl_ibcmp(aTHX_ lang, STR_WITH_LEN("UTF-8")) == 0 ||
+ Perl_ibcmp(aTHX_ lang, STR_WITH_LEN("UTF8") ) == 0);
#ifdef USE_LOCALE_CTYPE
if (curctype)
- utf8locale = (ibcmp(curctype, STR_WITH_LEN("UTF-8")) == 0 ||
- ibcmp(curctype, STR_WITH_LEN("UTF8") ) == 0);
+ utf8locale = (Perl_ibcmp(aTHX_ curctype, STR_WITH_LEN("UTF-8")) == 0 ||
+ Perl_ibcmp(aTHX_ curctype, STR_WITH_LEN("UTF8") ) == 0);
#endif
if (lc_all)
- utf8locale = (ibcmp(lc_all, STR_WITH_LEN("UTF-8")) == 0 ||
- ibcmp(lc_all, STR_WITH_LEN("UTF8") ) == 0);
+ utf8locale = (Perl_ibcmp(aTHX_ lc_all, STR_WITH_LEN("UTF-8")) == 0 ||
+ Perl_ibcmp(aTHX_ lc_all, STR_WITH_LEN("UTF8") ) == 0);
}
#endif /* USE_LOCALE */
if (utf8locale)
diff --git a/mg.c b/mg.c
index f13dd36f78..d1bed8e54a 100644
--- a/mg.c
+++ b/mg.c
@@ -1444,7 +1444,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
* tell whether HINT_STRICT_REFS is in force or not.
*/
if (!strchr(s,':') && !strchr(s,'\''))
- sv_insert(sv, 0, 0, STR_WITH_LEN("main::"));
+ Perl_sv_insert(aTHX_ sv, 0, 0, STR_WITH_LEN("main::"));
if (i)
(void)rsignal(i, PL_csighandlerp);
else
diff --git a/perl.c b/perl.c
index 728f91ce20..720fe15255 100644
--- a/perl.c
+++ b/perl.c
@@ -1860,7 +1860,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
/* break the line before that space */
opts = space - pv;
- sv_insert(opts_prog, opts, 0,
+ Perl_sv_insert(aTHX_ opts_prog, opts, 0,
STR_WITH_LEN("\\n "));
}
@@ -3505,7 +3505,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv)
PL_suidscript = -1;
if (PL_e_script) {
- PL_origfilename = savepvn(STR_WITH_LEN("-e"));
+ PL_origfilename = savepvs("-e");
}
else {
/* if find_script() returns, it returns a malloc()-ed value */
diff --git a/perlio.c b/perlio.c
index 6937b3609f..b49d978562 100644
--- a/perlio.c
+++ b/perlio.c
@@ -867,7 +867,7 @@ XS(XS_io_MODIFY_SCALAR_ATTRIBUTES)
SV *
PerlIO_tab_sv(pTHX_ PerlIO_funcs *tab)
{
- HV * const stash = gv_stashpvn(STR_WITH_LEN("PerlIO::Layer"), TRUE);
+ HV * const stash = gv_stashpvs("PerlIO::Layer", TRUE);
SV * const sv = sv_bless(newRV_noinc(newSViv(PTR2IV(tab))), stash);
return sv;
}
diff --git a/pp_sys.c b/pp_sys.c
index 54c7605f3f..eedabdb025 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1327,7 +1327,7 @@ PP(pp_leavewrite)
!gv_fetchpv("top", 0, SVt_PVFM))
IoTOP_NAME(io) = savesvpv(topname);
else
- IoTOP_NAME(io) = savepvn(STR_WITH_LEN("top"));
+ IoTOP_NAME(io) = savepvs("top");
}
topgv = gv_fetchpv(IoTOP_NAME(io), 0, SVt_PVFM);
if (!topgv || !GvFORM(topgv)) {
diff --git a/sv.c b/sv.c
index 6f296d71ce..e6690c11d4 100644
--- a/sv.c
+++ b/sv.c
@@ -11175,7 +11175,7 @@ S_varname(pTHX_ GV *gv, const char gvtype, PADOFFSET targ,
Perl_sv_catpvf(aTHX_ name, "[%"IVdf"]", (IV)aindex);
}
else if (subscript_type == FUV_SUBSCRIPT_WITHIN)
- sv_insert(name, 0, 0, STR_WITH_LEN("within "));
+ Perl_sv_insert(aTHX_ name, 0, 0, STR_WITH_LEN("within "));
return name;
}
diff --git a/sv.h b/sv.h
index 479b44279b..890166f2eb 100644
--- a/sv.h
+++ b/sv.h
@@ -1425,9 +1425,11 @@ Like C<sv_catsv> but doesn't process magic.
#define sv_2iv(sv) sv_2iv_flags(sv, SV_GMAGIC)
#define sv_2uv(sv) sv_2uv_flags(sv, SV_GMAGIC)
-#define newSVpvs(str) newSVpvn(STR_WITH_LEN(str))
-#define newSVpvs_share(str) newSVpvn_share(STR_WITH_LEN(str), 0)
-#define sv_catpvs(sv, str) sv_catpvn_flags(sv, STR_WITH_LEN(str), SV_GMAGIC)
+#define newSVpvs(str) Perl_newSVpvn(aTHX_ STR_WITH_LEN(str))
+#define newSVpvs_share(str) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(str), 0)
+#define sv_catpvs(sv, str) Perl_sv_catpvn_flags(aTHX_ sv, STR_WITH_LEN(str), SV_GMAGIC)
+#define savepvs(str) Perl_savepvn(aTHX_ STR_WITH_LEN(str))
+#define gv_stashpvs(str, create) Perl_gv_stashpvn(aTHX_ STR_WITH_LEN(str), create)
/* Should be named SvCatPVN_utf8_upgrade? */
#define sv_catpvn_utf8_upgrade(dsv, sstr, slen, nsv) \
diff --git a/toke.c b/toke.c
index 478ec7cdb8..fba0b331e7 100644
--- a/toke.c
+++ b/toke.c
@@ -460,7 +460,7 @@ S_missingterm(pTHX_ char *s)
#define FEATURE_IS_ENABLED(name) \
((0 != (PL_hints & HINT_LOCALIZE_HH)) \
- && feature_is_enabled(STR_WITH_LEN(name)))
+ && S_feature_is_enabled(aTHX_ STR_WITH_LEN(name)))
/*
* S_feature_is_enabled
* Check whether the named feature is enabled.