summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-10-31 14:18:14 +0000
committerNicholas Clark <nick@ccl4.org>2005-10-31 14:18:14 +0000
commit2b10efc65b3c9f7954b63da8917689cb9bab0804 (patch)
tree523ca9ff3be51567328ecc26bb8dfd8f44075f2d /embed.pl
parent46f1e5955033fcc63907c341337e8cc34722edf0 (diff)
downloadperl-2b10efc65b3c9f7954b63da8917689cb9bab0804.tar.gz
Arrange to only output each symbol once into global.sym
p4raw-id: //depot/perl@25923
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl31
1 files changed, 19 insertions, 12 deletions
diff --git a/embed.pl b/embed.pl
index a88016c493..2ef42aa994 100755
--- a/embed.pl
+++ b/embed.pl
@@ -243,20 +243,27 @@ sub write_protos {
$ret;
}
-# generates global.sym (API export list), and populates %global with global symbols
-sub write_global_sym {
- my $ret = "";
- if (@_ > 1) {
- my ($flags,$retval,$func,@args) = @_;
- if ($flags =~ /[AX]/ && $flags !~ /[xm]/
- || $flags =~ /b/) { # public API, so export
- $func = "Perl_$func" if $flags =~ /[pbX]/;
- $ret = "$func\n";
- }
- }
- $ret;
+# generates global.sym (API export list)
+{
+ my %seen;
+ sub write_global_sym {
+ my $ret = "";
+ if (@_ > 1) {
+ my ($flags,$retval,$func,@args) = @_;
+ # If a function is defined twice, for example before and after an
+ # #else, only process the flags on the first instance for global.sym
+ return $ret if $seen{$func}++;
+ if ($flags =~ /[AX]/ && $flags !~ /[xm]/
+ || $flags =~ /b/) { # public API, so export
+ $func = "Perl_$func" if $flags =~ /[pbX]/;
+ $ret = "$func\n";
+ }
+ }
+ $ret;
+ }
}
+
our $unflagged_pointers;
walk_table(\&write_protos, "proto.h", undef, "/* ex: set ro: */\n");
warn "$unflagged_pointers pointer arguments to clean up\n" if $unflagged_pointers;