summaryrefslogtreecommitdiff
path: root/handy.h
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 /handy.h
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
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h12
1 files changed, 12 insertions, 0 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