X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=indirect.xs;h=86675c854bb308199163930de6de3db224537390;hb=3e265f46afadfcfcf59a40560681ced9e33553a9;hp=b248a19ae64d16867ece884615a2873c7e2b8a8f;hpb=3540bf4697eff4d70c752e166b7bb44fbd256535;p=perl%2Fmodules%2Findirect.git diff --git a/indirect.xs b/indirect.xs index b248a19..86675c8 100644 --- a/indirect.xs +++ b/indirect.xs @@ -35,6 +35,10 @@ # define sv_catpvn_nomg sv_catpvn #endif +#ifndef mPUSHu +# define mPUSHu(U) PUSHs(sv_2mortal(newSVuv(U))) +#endif + #ifndef HvNAME_get # define HvNAME_get(H) HvNAME(H) #endif @@ -252,7 +256,7 @@ STATIC U32 indirect_hash = 0; STATIC SV *indirect_hint(pTHX) { #define indirect_hint() indirect_hint(aTHX) SV *id; -#if I_HAS_PERL(5, 10, 0) +#if I_HAS_PERL(5, 9, 5) id = Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash, NULL, __PACKAGE__, __PACKAGE_LEN__, @@ -512,16 +516,30 @@ STATIC OP *indirect_ck_entersub(pTHX_ OP *o) { if (mpos < opos) { SV *code = indirect_detag(hint); - if (hint) { + if (code) { + SV *file; + line_t line; dSP; + onamesv = sv_mortalcopy(onamesv); + mnamesv = sv_mortalcopy(mnamesv); + +#ifdef USE_ITHREADS + file = newSVpv(CopFILE(&PL_compiling), 0); +#else + file = sv_mortalcopy(CopFILESV(&PL_compiling)); +#endif + line = CopLINE(&PL_compiling); + ENTER; SAVETMPS; PUSHMARK(SP); - EXTEND(SP, 2); + EXTEND(SP, 4); PUSHs(onamesv); PUSHs(mnamesv); + PUSHs(file); + mPUSHu(line); PUTBACK; call_sv(code, G_VOID);