This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate mainline
[perl5.git] / ext / Thread / typemap
CommitLineData
8df6cea6 1Thread T_XSCPTR
d9bb3666
MB
2
3INPUT
8df6cea6 4T_XSCPTR
683929b4
MB
5 STMT_START {
6 MAGIC *mg;
7 SV *sv = ($arg);
8
9 if (!sv_isobject(sv))
10 croak(\"$var is not an object\");
8df6cea6 11 sv = (SV*)SvRV(sv);
7d901afa
MB
12 if (!SvRMAGICAL(sv) || !(mg = mg_find(sv, '~'))
13 || mg->mg_private != ${ntype}_MAGIC_SIGNATURE)
8df6cea6 14 croak(\"XSUB ${func_name}: $var is a forged ${ntype} object\");
683929b4 15 $var = ($type) SvPVX(mg->mg_obj);
bf49b057 16 DEBUG_S(PerlIO_printf(Perl_debug_log,
a835d317 17 \"XSUB ${func_name}: %p\\n\", $var));
683929b4 18 } STMT_END
734689b1
MB
19T_IVREF
20 if (SvROK($arg))
21 $var = ($type) SvIV((SV*)SvRV($arg));
22 else
23 croak(\"$var is not a reference\")
d9bb3666 24