Skip to content

Commit 39bc952

Browse files
committed
autodoc: Handle pTHX on no-long name functions
There are currently three functions that have an implicit thread context parameter that don't have long names. (A long name is prefixed with 'Perl_' or 'S_'.) Prior to this commit they were displayed in perlapi without that parameter. The three are Perl_localeconv, PerlIO_apply_layers, and PerlIO_binmode.
1 parent febfc89 commit 39bc952

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

autodoc.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,17 @@ ($fh, $element_name, $docref)
18391839
if ($has_args) {
18401840
@args = $item->{args}->@*;
18411841

1842+
# A thread context parameter is the default for functions (not
1843+
# macros) unless the T flag is specified. Those functions
1844+
# that don't have long names (indicated by not having any of
1845+
# the [IipS] flags have such an implicit parameter, that we
1846+
# need to make explicit for the documentation.
1847+
if ($item->{flags} !~ /[ IipS Mm T ]/xx) {
1848+
$this_has_pTHX = 1; # This 3 line design pattern is
1849+
unshift @args, "pTHX"; # repeated a few lines below
1850+
$any_has_pTHX_ = 1 if @args > 1;
1851+
}
1852+
18421853
# If only the Perl_foo form is to be displayed, change the
18431854
# name of this item to be that. This happens for either of
18441855
# two reasons:

0 commit comments

Comments
 (0)