summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-05-29 15:41:23 -0600
committerKarl Williamson <khw@cpan.org>2019-05-30 18:13:29 -0600
commitd7cc320995afaaf4d9c90b37e578f1fe79068198 (patch)
treeab4ffbbbcad88df359c751bf2e7f9e325242316c /autodoc.pl
parent54c193aee0eb1f20806952d8fcd2ddadd5e57600 (diff)
downloadperl-d7cc320995afaaf4d9c90b37e578f1fe79068198.tar.gz
autodoc.pl: Notice the no-thread context flag
I realized reading the code that it would be possible for a function definition to be wrongly output if it isn't called with a thread context variable. The information for that is already in embed.fnc, and so we just have to use it to avoid printing the variable if not present
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 26b4284dc8..2d56e81b79 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -134,6 +134,7 @@ DOC:
$flags .= 'O' if $embed_docref->{flags} =~ /O/;
$flags .= 'p' if $embed_docref->{flags} =~ /p/;
$flags .= 'M' if $embed_docref->{flags} =~ /M/;
+ $flags .= 'T' if $embed_docref->{flags} =~ /T/;
} else {
$missing{$name} = $file;
}
@@ -213,7 +214,7 @@ removed without notice.\n\n$docs" if $flags =~ /x/;
if $flags =~ /O/;
if ($p) {
$docs .= "NOTE: this function must be explicitly called as Perl_$name";
- $docs .= " with an aTHX_ parameter";
+ $docs .= " with an aTHX_ parameter" if $flags !~ /T/;
$docs .= ".\n\n"
}
@@ -243,7 +244,7 @@ removed without notice.\n\n$docs" if $flags =~ /x/;
}
}
my $args = '';
- if ($p) {
+ if ($p && $flags !~ /T/) {
$args = @args ? "pTHX_ " : "pTHX";
if ($long_args) { print $fh $args; $args = '' }
}