From: Vincent Pit Date: Fri, 25 Jun 2010 20:16:50 +0000 (+0200) Subject: Fix CLONE_PARAMS struct initialization for perl 5.13.2 X-Git-Tag: v0.43~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=aa28d3a561bda4e078b6af411526956ad84b2c38;p=perl%2Fmodules%2FVariable-Magic.git Fix CLONE_PARAMS struct initialization for perl 5.13.2 --- diff --git a/Magic.xs b/Magic.xs index c19b2f3..fab2340 100644 --- a/Magic.xs +++ b/Magic.xs @@ -79,13 +79,25 @@ STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { #define vmg_clone(P, O) vmg_clone(aTHX_ (P), (O)) + SV *dupsv; + +#if VMG_HAS_PERL(5, 13, 2) + CLONE_PARAMS *param = Perl_clone_params_new(owner, aTHX); + + dupsv = sv_dup(sv, param); + + Perl_clone_params_del(param); +#else CLONE_PARAMS param; param.stashes = NULL; /* don't need it unless sv is a PVHV */ param.flags = 0; param.proto_perl = owner; - return SvREFCNT_inc(sv_dup(sv, ¶m)); + dupsv = sv_dup(sv, ¶m); +#endif + + return SvREFCNT_inc(dupsv); } #endif /* VMG_THREADSAFE */