Skip to content

Commit e1e4832

Browse files
committed
autodoc: Variadic functions are callable with short form
We now create short name macros that expand to long name functions when the function takes a printf-style format. perlapi had not been changed to reflect that.
1 parent 14c379e commit e1e4832

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

autodoc.pl

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,29 +1895,17 @@ ($fh, $section_name, $element_name, $docref)
18951895
}
18961896

18971897
# If only the Perl_foo form is to be displayed, change the
1898-
# name of this item to be that. This happens for either of
1899-
# two reasons:
1900-
# 1) The flags say we want "Perl_", but also to not create
1901-
# an entry in embed.h to #define a short name for it.
1898+
# name of this item to be that. This happens when the flags
1899+
# say we want "Perl_", but also to not create an entry in
1900+
# embed.h to #define a short name for it.
19021901
my $needs_Perl_entry = ( $flags =~ /p/
19031902
&& $flags =~ /o/
19041903
&& $flags !~ /M/);
19051904

1906-
# 2) The function takes a format string and a thread context
1907-
# parameter. We can't cope with that because our macros
1908-
# expect both the thread context and the format to be the
1909-
# first parameter to the function; and only one can be in
1910-
# that position.
1911-
my $cant_use_short_name = ( ! $has_compat_macro{$name}
1912-
&& $flags =~ /f/
1913-
&& $flags !~ /T/
1914-
&& $name !~ /strftime/);
1915-
19161905
# We also create a 'Perl_foo' entry if $additional_long_form
19171906
# is set, as that explicitly indicates we want one
19181907
if ( $additional_long_form
1919-
|| $needs_Perl_entry
1920-
|| $cant_use_short_name)
1908+
|| $needs_Perl_entry)
19211909
{
19221910
# An all uppercase macro name gets an uppercase prefix.
19231911
my $perl = ($flags =~ /m/ && $name !~ /[[:lower:]]/)

0 commit comments

Comments
 (0)