diff options
author | Karl Williamson <khw@cpan.org> | 2020-09-05 16:37:22 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-09-05 17:31:10 -0600 |
commit | 8d1c4423972d220897e8e728ad14d8a0db1146a4 (patch) | |
tree | b2cf55faf991c5e4ed9ec62d0a84c64ebf3b77ff /autodoc.pl | |
parent | 6a84ef7c0ab2c1ad12cd72dfab63b40e367bae41 (diff) | |
download | perl-8d1c4423972d220897e8e728ad14d8a0db1146a4.tar.gz |
autodoc: Properly take into account pTHX
Before this patch, it wasn't considering the thread context when
deciding whether two forms of similar functions had the same signature
or not; hence not displaying things when it should have.
Diffstat (limited to 'autodoc.pl')
-rw-r--r-- | autodoc.pl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/autodoc.pl b/autodoc.pl index 38c17ba523..4a0c26d7c9 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -1108,6 +1108,15 @@ sub docout ($$$) { # output the docs for one function } else { + # Add the thread context formal parameter on expanded-out names + for my $item (@items) { + unshift $item->{args}->@*, (($item->{args}->@*) + ? "pTHX_" + : "pTHX") + if $item->{flags} !~ /T/ + && $item->{name} =~ /^Perl_/; + } + # Look through all the items in this entry. If all have the same # return type and arguments, only the main entry is displayed. # Also, find the longest return type and longest name so that if @@ -1150,12 +1159,6 @@ sub docout ($$$) { # output the docs for one function my $name = $item->{name}; my $item_flags = $item->{flags}; - # Display the thread context formal parameter on an expanded - # out name - if ($item_flags !~ /T/ && $name =~ /^Perl_/) { - unshift @args, (@args) ? "pTHX_" : "pTHX"; - } - # The return type print $fh (" " x $indent), $ret_type; |