Skip to content

Commit

Permalink
ParseXS: 5.8.9 backcompat fixes
Browse files Browse the repository at this point in the history
A couple of fixes to make it build+test under 5.8.9.

The grep expression

    exists $_->{in_out} && $_->{in_out} =~ /OUT$/

was wrong - it should have been defined rather than exists, as is done
elsewhere. I'm not sure why an 'uninit var' warning only appeared on 5.8.9
but not blead - perhaps some minor autovivification difference?

It was also warning

    $ExtUtils::ParseXS::DIE_ON_ERROR only used once
    $ExtUtils::ParseXS::AUTHOR_WARNINGS only used once

in t/001-basic.t because that test file only loads ExtUtils::ParseXS at
runtime. Again, I'm not sure why it didn't warn on blead too. But I made
the var initialisations more robust against 'once' warnings anyway by
using 'our'.
  • Loading branch information
iabyn committed Oct 8, 2024
1 parent 543cb98 commit d52927a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ EOF

for my $param (
grep {
exists $_->{in_out}
defined $_->{in_out}
&& $_->{in_out} =~ /OUT$/
&& !$self->{xsub_map_varname_to_seen_in_OUTPUT}{$_->{var}}
}
Expand Down
6 changes: 4 additions & 2 deletions dist/ExtUtils-ParseXS/t/001-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ require_ok( 'ExtUtils::ParseXS' );
chdir('t') if -d 't';
push @INC, '.';

$ExtUtils::ParseXS::DIE_ON_ERROR = 1;
$ExtUtils::ParseXS::AUTHOR_WARNINGS = 1;
package ExtUtils::ParseXS;
our $DIE_ON_ERROR = 1;
our $AUTHOR_WARNINGS = 1;
package main;

use Carp; #$SIG{__WARN__} = \&Carp::cluck;

Expand Down

0 comments on commit d52927a

Please sign in to comment.