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

index 338b6d3..1cf3937 100644 (file)
@@ -34,12 +34,14 @@ newSVsv_nomg
   } STMT_END
 #endif
 
-#if !defined(newSVsv_nomg) && defined(SV_NOSTEAL)
 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
-#  define newSVsv_nomg(sv) ({ SV *_sv = newSV(0); sv_setsv_flags(_sv, (sv), SV_NOSTEAL); _sv; })
+__UNDEFINED__ newSVsv_flags(sv, flags) ({ SV *_sv = newSV(0); sv_setsv_flags(_sv, (sv), (flags)); _sv; })
 #else
-#  define newSVsv_nomg(sv) ((PL_Sv = newSV(0)), sv_setsv_flags(PL_Sv, (sv), SV_NOSTEAL), PL_Sv)
+__UNDEFINED__ newSVsv_flags(sv, flags) ((PL_Sv = newSV(0)), sv_setsv_flags(PL_Sv, (sv), (flags)), PL_Sv)
 #endif
+
+#ifdef SV_NOSTEAL
+__UNDEFINED__ newSVsv_nomg(sv) newSVsv_flags((sv), SV_NOSTEAL)
 #endif
 
 __UNDEFINED__ SvMAGIC_set(sv, val) \