diff options
author | Karl Williamson <khw@cpan.org> | 2016-05-10 22:01:30 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-05-12 20:19:59 -0600 |
commit | 3f1866a8f6c7a9d70d0c8bb1b4f20d2db63756f1 (patch) | |
tree | 112311440160a302ebddadd85a8b3745e8cc94e9 /regen/embed.pl | |
parent | 1f207a974e82d7673df119f7fe72a576a69db068 (diff) | |
download | perl-3f1866a8f6c7a9d70d0c8bb1b4f20d2db63756f1.tar.gz |
embed.fnc: Alter 'b' flag meaning
This commit changes this flag to mean that the backward compatibility
functions are compiled unless the -DNO_MATHOMS cflag is specified to
Configure. Previously the meaning was sort of like that but not
precisely.
Doing this means that the prototypes that needed to be manually added to
mathoms.c are no longer needed. No special parameter assertions have to
be made. makedef.pl no longer needs to parse mathoms.c and have special
cases for it. And several special case entries in embed.fnc can be
non-special cased.
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-x | regen/embed.pl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/regen/embed.pl b/regen/embed.pl index 11b2e94f39..6007d92c39 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -81,8 +81,8 @@ my ($embed, $core, $ext, $api) = setup_embed(); my @nonnull; my $has_context = ( $flags !~ /n/ ); my $never_returns = ( $flags =~ /r/ ); - my $commented_out = ( $flags =~ /m/ ); my $binarycompat = ( $flags =~ /b/ ); + my $commented_out = ( ! $binarycompat && $flags =~ /m/ ); my $is_malloc = ( $flags =~ /a/ ); my $can_ignore = ( $flags !~ /R/ ) && !$is_malloc; my @names_of_nn; @@ -125,7 +125,9 @@ my ($embed, $core, $ext, $api) = setup_embed(); } } $func = full_name($plain_func, $flags); - $ret = "$retval\t$func("; + $ret = ""; + $ret .= "#ifndef NO_MATHOMS\n" if $binarycompat; + $ret .= "$retval\t$func("; if ( $has_context ) { $ret .= @args ? "pTHX_ " : "pTHX"; } @@ -219,6 +221,7 @@ my ($embed, $core, $ext, $api) = setup_embed(); $ret .= "\n#define PERL_ARGS_ASSERT_\U$plain_func\E\t\\\n\t" . join '; ', map "assert($_)", @names_of_nn; } + $ret .= "\n#endif" if $binarycompat; $ret .= @attrs ? "\n\n" : "\n"; print $pr $ret; @@ -324,6 +327,7 @@ sub embed_h { $ret .= "_ " if $alist; $ret .= $alist . ")\n"; } + $ret = "#ifndef NO_MATHOMS\n$ret#endif\n" if $flags =~ /b/; } $lines .= $ret; } |