From: Doug MacEachern Date: Sun, 18 Feb 2001 12:58:23 +0000 (-0800) Subject: [patch] xsubpp: make sv_setref_* targetable X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8fc4b7987e6639e8be4826c029947e2c978b9a2d;p=p5sagit%2Fp5-mst-13.2.git [patch] xsubpp: make sv_setref_* targetable Message-ID: p4raw-id: //depot/perl@8838 --- diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 2093633..0f3d1e6 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -274,7 +274,7 @@ foreach $key (keys %output_expr) { my ($t, $with_size, $arg, $sarg) = ($output_expr{$key} =~ - m[^ \s+ sv_set ( [iunp] ) v (n)? # Type, is_setpvn + m[^ \s+ sv_set ( [iunp] | ref_[iunp] ) v (n)? # Type, is_setpvn \s* \( \s* $cast \$arg \s* , \s* ( (??{ $bal }) ) # Set from ( (??{ $size }) )? # Possible sizeof set-from @@ -1354,6 +1354,18 @@ EOF print "\tsv_setpv(TARG, $what); XSprePUSH; PUSHTARG;\n"; $prepush_done = 1; } + elsif ($t and $t->[0] =~ /^ref_/) { + local $ntype = $ret_type; + my $what = eval qq("$t->[2]"); + warn $@ if $@; + my $size = $t->[3]; + $size = '' unless defined $size; + $size = eval qq("$size"); + my $n = $t->[1] || ''; + warn $@ if $@; + print "\tXSprePUSH; sv_set$t->[0]v$n(TARG, $what$size); PUSHTARG;\n"; + $prepush_done = 1; + } elsif ($t) { my $what = eval qq("$t->[2]"); warn $@ if $@;