summaryrefslogtreecommitdiff
path: root/regen/embed.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-05-18 05:40:51 -0600
committerKarl Williamson <khw@cpan.org>2022-05-18 06:04:16 -0600
commit3f394718e38b9e45a86ed2ca1ce5d8a54976e488 (patch)
treecd40d5ac0e660798148c0fb6591767a882c2f8cd /regen/embed.pl
parent04b7ea23be8b67009abbbd968b3803fc1ea7c33a (diff)
downloadperl-3f394718e38b9e45a86ed2ca1ce5d8a54976e488.tar.gz
regen/embed.pl: Allow perl_' prefix to names
Normally, the embed.fnc C flag requires a p flag to make sure that the name starts with 'Perl_', to avoid polluting the caller's name space. This commit makes an exception to that if the name already starts with [Pp]erl. This is because we have few old functions whose name starts with 'perl_', and hence they don't fit in with the newer scheme of things. The meanings of the O and o flags in combination could have been tweaked, but this is the simplest solution, namely: If the name isn't going to pollute, it's ok no matter what the flags say.
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-xregen/embed.pl13
1 files changed, 11 insertions, 2 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 3a3034bb79..5d2f297f13 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -136,10 +136,20 @@ my ($embed, $core, $ext, $api) = setup_embed();
}
}
+ $func = full_name($plain_func, $flags);
+
die_at_end "For '$plain_func', M flag requires p flag"
if $flags =~ /M/ && $flags !~ /p/;
die_at_end "For '$plain_func', C flag requires one of [pIimb] flags"
- if $flags =~ /C/ && $flags !~ /[Iibmp]/;
+ if $flags =~ /C/
+ && ($flags !~ /[Iibmp]/
+
+ # Notwithstanding the
+ # above, if the name
+ # won't clash with a
+ # user name, it's ok.
+ && $plain_func !~ /^[Pp]erl/);
+
die_at_end "For '$plain_func', X flag requires one of [Iip] flags"
if $flags =~ /X/ && $flags !~ /[Iip]/;
die_at_end "For '$plain_func', X and m flags are mutually exclusive"
@@ -153,7 +163,6 @@ my ($embed, $core, $ext, $api) = setup_embed();
die_at_end "For '$plain_func', I and i flags are mutually exclusive"
if $flags =~ /I/ && $flags =~ /i/;
- $func = full_name($plain_func, $flags);
$ret = "";
$ret .= "$retval\t$func(";
if ( $has_context ) {