diff options
author | Leon Timmermans <fawaka@gmail.com> | 2023-03-29 17:13:07 +0200 |
---|---|---|
committer | Leon Timmermans <fawaka@gmail.com> | 2023-03-30 13:29:45 +0200 |
commit | 9ed785eddca4c01f5de2ef4bfb539dc2babeceed (patch) | |
tree | 3a579c9973fdb93b26adee4bd10d2316e50e95f6 /dist | |
parent | 86e7b6187ab846b0bfdab1d5d58e1cec5182cedd (diff) | |
download | perl-9ed785eddca4c01f5de2ef4bfb539dc2babeceed.tar.gz |
ParseXS: Correct colon translation of $type in OUTPUT section
The $type variable in typemaps is documented as in perlxstypemap as
"any : replaced with _", however currently it only does so in INPUT
sections. This will also make it do the same in OUTPUT sections.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index 4dfb7c7f47..3975dd480d 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -2166,8 +2166,9 @@ sub generate_output { (my $ntype = $type) =~ s/\s*\*/Ptr/g; $ntype =~ s/\(\)//g; (my $subtype = $ntype) =~ s/(?:Array)?(?:Ptr)?$//; + $type =~ tr/:/_/ unless $self->{RetainCplusplusHierarchicalTypes}; - my $eval_vars = {%$argsref, subtype => $subtype, ntype => $ntype, arg => $arg}; + my $eval_vars = {%$argsref, subtype => $subtype, ntype => $ntype, arg => $arg, type => $type }; my $expr = $outputmap->cleaned_code; if ($expr =~ /DO_ARRAY_ELEM/) { my $subtypemap = $typemaps->get_typemap(ctype => $subtype); |