In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/8465c88d321256783d00b03482a840dab3ad16be?hp=f6c6dcb63681097ed0944b9c7a8d91a87186184d>
- Log ----------------------------------------------------------------- commit 8465c88d321256783d00b03482a840dab3ad16be Author: Steffen Mueller <smuel...@cpan.org> Date: Tue May 22 23:04:06 2012 +0200 Make CV * typemap entry support overloading See RT #96872. ----------------------------------------------------------------------- Summary of changes: lib/ExtUtils/typemap | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap index 607c6c8..0fa14fb 100644 --- a/lib/ExtUtils/typemap +++ b/lib/ExtUtils/typemap @@ -143,12 +143,12 @@ T_HVREF_REFCOUNT_FIXED } STMT_END T_CVREF STMT_START { - SV* const xsub_tmp_sv = $arg; + HV *st; + GV *gvp; + SV * const xsub_tmp_sv = $arg; SvGETMAGIC(xsub_tmp_sv); - if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv)) == SVt_PVCV){ - $var = (CV*)SvRV(xsub_tmp_sv); - } - else{ + $var = sv_2cv(xsub_tmp_sv, &st, &gvp, 0); + if (!$var) { Perl_croak(aTHX_ \"%s: %s is not a CODE reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); @@ -156,12 +156,12 @@ T_CVREF } STMT_END T_CVREF_REFCOUNT_FIXED STMT_START { - SV* const xsub_tmp_sv = $arg; + HV *st; + GV *gvp; + SV * const xsub_tmp_sv = $arg; SvGETMAGIC(xsub_tmp_sv); - if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv)) == SVt_PVCV){ - $var = (CV*)SvRV(xsub_tmp_sv); - } - else{ + $var = sv_2cv(xsub_tmp_sv, &st, &gvp, 0); + if (!$var) { Perl_croak(aTHX_ \"%s: %s is not a CODE reference\", ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]}, \"$var\"); -- Perl5 Master Repository