From: Vincent Pit Date: Sat, 20 Sep 2008 22:35:07 +0000 (+0200) Subject: Move vmg_clone() upwards X-Git-Tag: v0.20~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=9e4e50e7055da570fbaa1116842593c536158e77;p=perl%2Fmodules%2FVariable-Magic.git Move vmg_clone() upwards --- diff --git a/Magic.xs b/Magic.xs index b62d5f7..b4ff243 100644 --- a/Magic.xs +++ b/Magic.xs @@ -63,6 +63,19 @@ # define MY_CXT_CLONE NOOP #endif +#if VMG_MULTIPLICITY + +STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { +#define vmg_clone(P, O) vmg_clone(aTHX_ (P), (O)) + CLONE_PARAMS param; + param.stashes = NULL; /* don't need it unless sv is a PVHV */ + param.flags = 0; + param.proto_perl = owner; + return sv_dup(sv, ¶m); +} + +#endif /* VMG_MULTIPLICITY */ + /* --- Compatibility ------------------------------------------------------- */ #ifndef Newx @@ -775,15 +788,6 @@ STATIC SV *vmg_wizard_wiz(pTHX_ SV *wiz) { #if VMG_MULTIPLICITY -STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { -#define vmg_clone(P, O) vmg_clone(aTHX_ (P), (O)) - CLONE_PARAMS param; - param.stashes = NULL; /* don't need it unless sv is a PVHV */ - param.flags = 0; - param.proto_perl = owner; - return sv_dup(sv, ¶m); -} - #define VMG_CLONE_CB(N) \ z->cb_ ## N = (w->cb_ ## N) ? newRV_noinc(vmg_clone(SvRV(w->cb_ ## N), \ w->owner)) \