Subject: | Can't pass AV* with perl-5.10 |
Here's the demo script:
-------------------------------
use warnings;
use Inline CPP => <<'EOC';
void greet(AV * foo) {
printf("Hello World\n");
}
EOC
my @test = (1, 2);
greet(\@test);
-------------------------------
Prior to perl 5.10, there's no problem with that script. But with perl
5.10, the script compiles, but then produces the error that it "Can't
locate auto/main/greet.al in @INC ... ".
Here's a patch that fixes the problem (though I don't know that it's
the correct fix):
-------------------------------
--- CPP.pm_orig Tue Jun 3 16:43:39 2008
+++ CPP.pm Wed Jun 4 12:27:24 2008
@@ -478,8 +478,12 @@
my $dir = shift;
my $preproc = shift;
my $tkind = $o->{ILSM}{typeconv}{type_kind}{$type};
- my $ret =
+ my $ret;
+ {
+ no strict;
+ $ret =
eval qq{qq{$o->{ILSM}{typeconv}{$dir}{$tkind}}};
+ }
chomp $ret;
$ret =~ s/\n/\\\n/g if $preproc;
return $ret;
-------------------------------
Cheers,
Rob