summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-04 16:42:03 +0000
committerGisle Aas <gisle@activestate.com>2006-01-04 16:42:03 +0000
commitba3a79e7bc1290494bbec9ddd2cd46b87300eb54 (patch)
treecc1336cd95fc8c5c9ed7e6c1a0a3deb39e879cf8
parent89529cee496f815eec2d49f2510449af5063ddd8 (diff)
downloadperl-ba3a79e7bc1290494bbec9ddd2cd46b87300eb54.tar.gz
Move all the xxxpvs() macros to handy.h.
This brings them closer to STR_WITH_LEN. Besides only half of them were sv-related after change 26649. p4raw-id: //depot/perl@26650
-rw-r--r--handy.h12
-rw-r--r--sv.h6
2 files changed, 12 insertions, 6 deletions
diff --git a/handy.h b/handy.h
index 5bcbe05566..4fc2b88671 100644
--- a/handy.h
+++ b/handy.h
@@ -239,6 +239,18 @@ typedef U64TYPE U64;
/* concatenating with "" ensures that only literal strings are accepted as argument */
#define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
+/* note that STR_WITH_LEN() can't be used as argument to macros or functions that
+ * under some configurations might be macros, which means that it requires the full
+ * Perl_xxx(aTHX_ ...) form for any API calls where it's used.
+ */
+
+/* STR_WITH_LEN() shortcuts */
+#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)
+
/*
=head1 Miscellaneous Functions
diff --git a/sv.h b/sv.h
index 890166f2eb..b5aeac8feb 100644
--- a/sv.h
+++ b/sv.h
@@ -1425,12 +1425,6 @@ 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) 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) \
STMT_START { \