Skip to content

Commit

Permalink
(perl #133654) don't include OUTLIST parameters in the prototype
Browse files Browse the repository at this point in the history
The generated prototype (with PROTOTYPES: ENABLE) would include
OUTLIST parameters, but these aren't arguments to the perl function.
  • Loading branch information
tonycoz committed Dec 5, 2018
1 parent fb5f378 commit 028027e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Expand Up @@ -467,7 +467,7 @@ EOM
$self->{defaults}->{$args[$i]} = $2; $self->{defaults}->{$args[$i]} = $2;
$self->{defaults}->{$args[$i]} =~ s/"/\\"/g; $self->{defaults}->{$args[$i]} =~ s/"/\\"/g;
} }
$self->{proto_arg}->[$i+1] = '$'; $self->{proto_arg}->[$i+1] = '$' unless $only_C_inlist_ref->{$args[$i]};
} }
my $min_args = $num_args - $extra_args; my $min_args = $num_args - $extra_args;
$report_args =~ s/"/\\"/g; $report_args =~ s/"/\\"/g;
Expand Down
7 changes: 5 additions & 2 deletions dist/ExtUtils-ParseXS/t/002-more.t
Expand Up @@ -9,7 +9,7 @@ use ExtUtils::CBuilder;
use attributes; use attributes;
use overload; use overload;


plan tests => 29; plan tests => 30;


my ($source_file, $obj_file, $lib_file); my ($source_file, $obj_file, $lib_file);


Expand Down Expand Up @@ -48,7 +48,7 @@ SKIP: {
} }


SKIP: { SKIP: {
skip "no dynamic loading", 25 skip "no dynamic loading", 26
if !$b->have_compiler || !$Config{usedl}; if !$b->have_compiler || !$Config{usedl};
my $module = 'XSMore'; my $module = 'XSMore';
$lib_file = $b->link( objects => $obj_file, module_name => $module ); $lib_file = $b->link( objects => $obj_file, module_name => $module );
Expand Down Expand Up @@ -92,6 +92,9 @@ SKIP: {


is_deeply [XSMore::outlist()], [ord('a'), ord('b')], 'the OUTLIST keyword'; is_deeply [XSMore::outlist()], [ord('a'), ord('b')], 'the OUTLIST keyword';


# eval so compile-time sees any prototype
is_deeply [ eval 'XSMore::outlist()' ], [ord('a'), ord('b')], 'OUTLIST prototypes';

is XSMore::len("foo"), 3, 'the length keyword'; is XSMore::len("foo"), 3, 'the length keyword';


is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive'; is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive';
Expand Down

0 comments on commit 028027e

Please sign in to comment.