diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-08-28 15:59:05 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 06:19:31 -0700 |
commit | f34d8cddb66ff0384d68d9388041c9a299f2bb09 (patch) | |
tree | 07937dcfaf77aeea2808f09095b32e6dea713311 /sv.h | |
parent | c5569a55d25985ac28c100b33e16111ca928c1f9 (diff) | |
download | perl-f34d8cddb66ff0384d68d9388041c9a299f2bb09.tar.gz |
sv_cathek
This macro, intended for internal use, simplifies the code in
a couple of places.
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1970,6 +1970,12 @@ mg.c:1024: warning: left-hand operand of comma expression has no effect (littlelen), SV_GMAGIC) #define sv_mortalcopy(sv) \ Perl_sv_mortalcopy_flags(aTHX_ sv, SV_GMAGIC|SV_DO_COW_SVSETSV) +#define sv_cathek(sv,hek) \ + STMT_START { \ + HEK * const bmxk = hek; \ + sv_catpvn_flags(sv, HEK_KEY(bmxk), HEK_LEN(bmxk), \ + HEK_UTF8(bmxk) ? SV_CATUTF8 : SV_CATBYTES); \ + } STMT_END /* Should be named SvCatPVN_utf8_upgrade? */ #define sv_catpvn_nomg_utf8_upgrade(dsv, sstr, slen, nsv) \ |