]> git.imager.perl.org - imager.git/blob - typemap.oldperl
avoid i_push_errorf() and i_fatal() in a few more places
[imager.git] / typemap.oldperl
1 # typemaps for perl before 5.8
2 # STRLEN isn't in the default typemap in older perls
3 STRLEN                  T_UV
4
5 #############################################################################
6 INPUT
7 # the pre-5.8.0 T_AVREF input map was fixed in 5.8.0
8 T_AVREF
9         STMT_START {
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);
14             else
15                 Perl_croak(aTHX_ \"$var is not an array reference\");
16         } STMT_END
17
18 # the pre-5.8.0 T_HVREF input map was fixed in 5.8.0
19 T_HVREF
20         STMT_START {
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);
25             else
26                 Perl_croak(aTHX_ \"$var is not a hash reference\");
27         } STMT_END
28