This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/embed.pl: Wrap #if..#endif differently
authorKarl Williamson <khw@cpan.org>
Mon, 9 Sep 2019 17:43:18 +0000 (11:43 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 15 Sep 2019 16:39:55 +0000 (10:39 -0600)
By surrounding the interior stuff with these in one statement, it makes
it easier to change that interior stuff without having dangling
statements.

This makes no difference in the current generated output

regen/embed.pl

index 4fefd7a..c59d877 100755 (executable)
@@ -135,8 +135,6 @@ my ($embed, $core, $ext, $api) = setup_embed();
 
        $func = full_name($plain_func, $flags);
        $ret = "";
-       $ret .= "#ifndef NO_MATHOMS\n" if $binarycompat;
-       $ret .= "#ifndef PERL_NO_INLINE_FUNCTIONS\n" if $static_inline;
        $ret .= "$retval\t$func(";
        if ( $has_context ) {
            $ret .= @args ? "pTHX_ " : "pTHX";
@@ -229,8 +227,9 @@ 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 $static_inline;
-       $ret .= "\n#endif" if $binarycompat;
+
+       $ret = "#ifndef PERL_NO_INLINE_FUNCTIONS\n$ret\n#endif" if $static_inline;
+       $ret = "#ifndef NO_MATHOMS\n$ret\n#endif" if $binarycompat;
        $ret .= @attrs ? "\n\n" : "\n";
 
        print $pr $ret;