]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Fix CLONE_PARAMS struct initialization for perl 5.13.2
authorVincent Pit <vince@profvince.com>
Fri, 25 Jun 2010 20:16:50 +0000 (22:16 +0200)
committerVincent Pit <vince@profvince.com>
Fri, 25 Jun 2010 20:21:43 +0000 (22:21 +0200)
Magic.xs

index c19b2f3cc04fe549a207266dbd417d506355c9b9..fab2340743ca8f1f1d06d8ada018c90bf59ada41 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
 
 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, &param));
+ dupsv = sv_dup(sv, &param);
+#endif
+
+ return SvREFCNT_inc(dupsv);
 }
 
 #endif /* VMG_THREADSAFE */