This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[patch] xsubpp: make sv_setref_* targetable
authorDoug MacEachern <dougm@covalent.net>
Sun, 18 Feb 2001 12:58:23 +0000 (04:58 -0800)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 18 Feb 2001 22:17:54 +0000 (22:17 +0000)
Message-ID: <Pine.LNX.4.21.0102181256310.10021-100000@mako.covalent.net>

p4raw-id: //depot/perl@8838

lib/ExtUtils/xsubpp

index 2093633..0f3d1e6 100755 (executable)
@@ -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 $@;