summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-06-08 06:49:59 -0600
committerKarl Williamson <khw@cpan.org>2022-06-14 07:38:50 -0600
commitc43e2db585193d859602960fa5f4a826b76f0f1e (patch)
tree55a04f31da823a0d3f091b32eeb2849b1eb9b8e4
parent07b6261fb1bd833cdc1794d2de7fc09ce103c952 (diff)
downloadperl-c43e2db585193d859602960fa5f4a826b76f0f1e.tar.gz
regen/embed.pl: Add static Perl_ not_inlined capability
This will be used in the next commit
-rw-r--r--embed.fnc8
-rw-r--r--makedef.pl4
-rwxr-xr-xregen/embed.pl10
3 files changed, 16 insertions, 6 deletions
diff --git a/embed.fnc b/embed.fnc
index 9fca0b7819..16993ae3ae 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -500,6 +500,14 @@
: STATIC is added to declaration;
: embed.h: "#define foo S_foo" entries added
:
+: s Static function, but function in source code has a Perl_ prefix:
+:
+: This is used for functions that have always had a Perl_ prefix, but
+: have been moved to a header file and declared static.
+:
+: proto.h: function is declared as Perl_foo rather than foo
+: STATIC is added to declaration;
+: embed.h: "#define foo Perl_foo" entries added
:
: T Has no implicit interpreter/thread context argument:
:
diff --git a/makedef.pl b/makedef.pl
index 99090cb417..ef77b83ce1 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -696,7 +696,7 @@ unless ($Config{d_wcrtomb}) {
{
my %seen;
my ($embed) = setup_embed($ARGS{TARG_DIR});
- my $excludedre = $define{'NO_MATHOMS'} ? qr/[emiIb]/ : qr/[emiI]/;
+ my $excludedre = $define{'NO_MATHOMS'} ? qr/[emiIsb]/ : qr/[emiIs]/;
foreach (@$embed) {
my ($flags, $retval, $func, @args) = @$_;
@@ -712,7 +712,7 @@ unless ($Config{d_wcrtomb}) {
# mean "don't export"
next if $seen{$func}++;
# Should we also skip adding the Perl_ prefix if $flags =~ /o/ ?
- $func = "Perl_$func" if ($flags =~ /[pX]/ && $func !~ /^Perl_/);
+ $func = "Perl_$func" if ($flags =~ /[psX]/ && $func !~ /^Perl_/);
++$export{$func} unless exists $skip{$func};
}
}
diff --git a/regen/embed.pl b/regen/embed.pl
index d8ddbb1113..09853c63eb 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -48,7 +48,7 @@ sub full_name ($$) { # Returns the function name with potentially the
# prefixes 'S_' or 'Perl_'
my ($func, $flags) = @_;
- return "Perl_$func" if $flags =~ /p/;
+ return "Perl_$func" if $flags =~ /[ps]/;
return "S_$func" if $flags =~ /[SIi]/;
return $func;
}
@@ -79,7 +79,7 @@ my ($embed, $core, $ext, $api) = setup_embed();
}
my ($flags,$retval,$plain_func,@args) = @$_;
- if ($flags =~ / ( [^AabCDdEefFGhIiMmNnOoPpRrSTUuWXx;] ) /x) {
+ if ($flags =~ / ( [^AabCDdEefFGhIiMmNnOoPpRrSsTUuWXx;] ) /x) {
die_at_end "flag $1 is not legal (for function $plain_func)";
}
my @nonnull;
@@ -107,11 +107,12 @@ my ($embed, $core, $ext, $api) = setup_embed();
&& $flags !~ /m/;
my $static_inline = 0;
- if ($flags =~ /([SIi])/) {
+ if ($flags =~ /([SsIi])/) {
my $type;
if ($never_returns) {
$type = {
'S' => 'PERL_STATIC_NO_RET',
+ 's' => 'PERL_STATIC_NO_RET',
'i' => 'PERL_STATIC_INLINE_NO_RET',
'I' => 'PERL_STATIC_FORCE_INLINE_NO_RET'
}->{$1};
@@ -119,6 +120,7 @@ my ($embed, $core, $ext, $api) = setup_embed();
else {
$type = {
'S' => 'STATIC',
+ 's' => 'STATIC',
'i' => 'PERL_STATIC_INLINE',
'I' => 'PERL_STATIC_FORCE_INLINE'
}->{$1};
@@ -140,7 +142,7 @@ my ($embed, $core, $ext, $api) = setup_embed();
die_at_end "For '$plain_func', M flag requires p flag"
if $flags =~ /M/ && $flags !~ /p/;
- my $C_required_flags = '[pIimb]';
+ my $C_required_flags = '[pIimbs]';
die_at_end
"For '$plain_func', C flag requires one of $C_required_flags] flags"
if $flags =~ /C/