This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Implement sv_mortalcopy_flags()
authorPali <pali@cpan.org>
Thu, 4 Jul 2019 15:05:34 +0000 (17:05 +0200)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:27 +0000 (16:39 -0600)
(cherry picked from commit a8ddf81bea0c2c5a7476a76c98b307764f69bee5)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/Sv_set

index 1cf3937..78a8034 100644 (file)
@@ -44,6 +44,12 @@ __UNDEFINED__ newSVsv_flags(sv, flags) ((PL_Sv = newSV(0)), sv_setsv_flags(PL_Sv
 __UNDEFINED__ newSVsv_nomg(sv) newSVsv_flags((sv), SV_NOSTEAL)
 #endif
 
 __UNDEFINED__ newSVsv_nomg(sv) newSVsv_flags((sv), SV_NOSTEAL)
 #endif
 
+#if { VERSION >= 5.17.5 }
+__UNDEFINED__ sv_mortalcopy_flags(sv, flags) Perl_sv_mortalcopy_flags(aTHX_ (sv), (flags))
+#else
+__UNDEFINED__ sv_mortalcopy_flags(sv, flags) sv_2mortal(newSVsv_flags((sv), (flags)))
+#endif
+
 __UNDEFINED__ SvMAGIC_set(sv, val) \
                 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
                 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
 __UNDEFINED__ SvMAGIC_set(sv, val) \
                 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
                 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END