diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-01-29 09:53:44 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-01-29 10:26:41 -0700 |
commit | 71556506e314e769ce97e03177d978fbd8a37c18 (patch) | |
tree | 313dd82a60fc951c0a8d87a122a8d145fd693b63 | |
parent | e5228720d6fdc243999d812a7a89ca41dd4c11bf (diff) | |
download | perl-71556506e314e769ce97e03177d978fbd8a37c18.tar.gz |
embed.fnc: Add inline function capability
This patch adds to embed.pl the capability to generate static inline functions.
-rw-r--r-- | embed.fnc | 6 | ||||
-rwxr-xr-x | regen/embed.pl | 9 |
2 files changed, 12 insertions, 3 deletions
@@ -46,6 +46,12 @@ : : proto.h: add __attribute__format__ (or ...null_ok__) : +: i Static inline: function in source code has a S_ prefix: +: +: proto.h: function is declared as S_foo rather than foo, +: PERL_STATIC_INLINE is added to declaration; +: embed.h: "#define foo S_foo" entries added +: : M May change: : : any doc entry is marked that function may change diff --git a/regen/embed.pl b/regen/embed.pl index b7d784970b..b6a25356b4 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -231,8 +231,11 @@ sub walk_table (&@) { } } - if ($flags =~ /s/) { - $retval = "STATIC $splint_flags$retval"; + if ($flags =~ /([si])/) { + my $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"; $func = "S_$plain_func"; } else { @@ -468,7 +471,7 @@ sub embed_h { $ret = "#define $func($alist)"; my $t = int(length($ret) / 8); $ret .= "\t" x ($t < 4 ? 4 - $t : 1); - if ($flags =~ /s/) { + if ($flags =~ /[si]/) { $ret .= "S_$func(aTHX"; } elsif ($flags =~ /p/) { |