From ee8784f4fee8e330f86fd75c327ba72cfe2c91da Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 30 Jan 2012 17:48:05 +0000 Subject: (get_paras) do not rename *__XS functions anymore copy their signatures to their perl wrappers so that they got signatures too (now that we parse the .pm files too) instead of shadowing the perl function with no signatures eg: -sub parse_hdlist() {} +sub parse_hdlist { my ($_urpm, $_filename, @_more_paras) = @_ } --- fake_packages/gen.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fake_packages/gen.pl b/fake_packages/gen.pl index f65c3e6..acedc93 100755 --- a/fake_packages/gen.pl +++ b/fake_packages/gen.pl @@ -123,7 +123,7 @@ my ($pkg_name, $dir) = @ARGV; my @xs_files = chomp_(`find $dir -name "*.xs"`); # ignore test suites, inc/ and ext/ : my @pm_files = chomp_(`find $dir -name "*.pm" | egrep -v '/(ext|inc|t)/'`); -@ARGV == 2 && @xs_files or die "usage: gen.pl \n"; +@ARGV == 2 && (@xs_files || @pm_files) or die "usage: gen.pl \n"; parse_xs($_) foreach @xs_files; parse_pm($_) foreach @pm_files; @@ -134,11 +134,13 @@ foreach my $pkg (sort keys %l) { print "\npackage $pkg;\n"; print "our \@ISA = qw();\n"; foreach my $name (sort keys %{$l{$pkg}}) { - my $para = $l{$pkg}{$name}; + my $xs_name = $name . "__XS"; + my $para = $l{$pkg}{$xs_name} || $l{$pkg}{$name}; $name = $pkg . '::' . $name if $name =~ /^(ne|eq|foreach|format|ge|length|sub|x|xor|y)$/; - $name =~ s/__XS$//; # fix for URPM if (@$para) { print "sub $name { my (", join(", ", @$para), ") = \@_ }\n"; + } elsif ($name =~ /\(/) { + print "sub $name {}\n"; } else { print "sub $name() {}\n"; } -- cgit v1.2.1