1 # typemaps for perl before 5.8
2 # STRLEN isn't in the default typemap in older perls
6 #############################################################################
8 # the pre-5.8.0 T_AVREF input map was fixed in 5.8.0
11 SV *const xsub_tmp_sv = $arg;
12 SvGETMAGIC(xsub_tmp_sv);
13 if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv))==SVt_PVAV)
14 $var = (AV*)SvRV(xsub_tmp_sv);
16 Perl_croak(aTHX_ \"$var is not an array reference\");
19 # the pre-5.8.0 T_HVREF input map was fixed in 5.8.0
22 SV *const xsub_tmp_sv = $arg;
23 SvGETMAGIC(xsub_tmp_sv);
24 if (SvROK(xsub_tmp_sv) && SvTYPE(SvRV(xsub_tmp_sv))==SVt_PVHV)
25 $var = (HV*)SvRV(xsub_tmp_sv);
27 Perl_croak(aTHX_ \"$var is not a hash reference\");