diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-10-10 17:23:27 -0400 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-10-10 17:09:05 -0600 |
commit | 98c015b7a9b5140b2750b25518eb68b5024d7652 (patch) | |
tree | 8024448b612f5a6ed32e14adc9d2fd6916668b54 /regen/embed.pl | |
parent | 451f421fe4742646fa2efbed0f45a19f0713d00f (diff) | |
download | perl-98c015b7a9b5140b2750b25518eb68b5024d7652.tar.gz |
fix C++ builds broken by cdc4a174060
In commit cdc4a174060 static noreturn function, on a C++ build, (specific
example, GCC ) got a post preprocessor prototype of
"extern "C" static void S_fn_doesnt_return(". GCC generates a compile error
if "extern "C"" and static used together. Plain C build were not affected.
This commit fixed the problem by creating 2 new static exclusive macros, so
extern "C" does not wind up on statics in a C++ build. The macros allow
enough flexibility so any compiler/platform that needs a noreturn
declaration specifier instead of a noreturn function attribute can have
one.
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-x | regen/embed.pl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/regen/embed.pl b/regen/embed.pl index a7419ba26d..1f5b7497ce 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -85,13 +85,16 @@ my ($embed, $core, $ext, $api) = setup_embed(); } if ($flags =~ /([si])/) { - my $type = ($1 eq 's') ? "STATIC" : "PERL_STATIC_INLINE"; + my $type; + if ($never_returns) { + $type = $1 eq 's' ? "PERL_STATIC_NO_RET" : "PERL_STATIC_INLINE_NO_RET"; + } + else { + $type = $1 eq 's' ? "STATIC" : "PERL_STATIC_INLINE"; + } warn "$func: i and s flags are mutually exclusive" if $flags =~ /s/ && $flags =~ /i/; $retval = "$type $splint_flags$retval"; - if ($never_returns) { - $retval = "PERL_CALLCONV_NO_RET $retval"; - } $func = "S_$plain_func"; } else { |