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