diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-22 11:37:02 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-22 11:37:02 +0000 |
commit | 565e2fca1eb6efc2373e28812a12c2d4e3e9470e (patch) | |
tree | 2eb730287660b5e7bddba6a64fb558aa5d061e1b /win32 | |
parent | c6af7a1aaf1f569eeb51c976b436561fdc569904 (diff) | |
download | perl-565e2fca1eb6efc2373e28812a12c2d4e3e9470e.tar.gz |
fix broken CAPI generation
p4raw-id: //depot/perl@2262
Diffstat (limited to 'win32')
-rw-r--r-- | win32/GenCAPI.pl | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl index 5c77d70112..5972c2a279 100644 --- a/win32/GenCAPI.pl +++ b/win32/GenCAPI.pl @@ -3,34 +3,34 @@ # takes one argument, the path to lib/CORE directory. # creates 2 files: "perlCAPI.cpp" and "perlCAPI.h". -my $hdrfile = "$ARGV[0]\\perlCAPI.h"; -my $infile = '..\\proto.h'; -my $embedfile = '..\\embed.h'; +my $hdrfile = "$ARGV[0]/perlCAPI.h"; +my $infile = '../proto.h'; +my @embedsyms = ('../global.sym', '../pp.sym'); my $separateObj = 0; my %skip_list; my %embed; -sub readembed(\%$) { - my ($syms, $file) = @_; +sub readsyms(\%@) { + my ($syms, @files) = @_; my ($line, @words); %$syms = (); - local (*FILE, $_); - open(FILE, "< $file") - or die "$0: Can't open $file: $!\n"; - while ($line = <FILE>) { - chop($line); - if ($line =~ /^#define\s+\w+/) { - $line =~ s/^#define\s+//; - @words = split ' ', $line; -# print "$words[0]\t$words[1]\n"; - $$syms{$words[0]} = $words[1]; + foreach my $file (@files) { + local (*FILE, $_); + open(FILE, "< $file") + or die "$0: Can't open $file: $!\n"; + while (<FILE>) { + s/[ \t]*#.*$//; # delete comments + if (/^\s*(\S+)\s*$/) { + my $sym = $1; + $$syms{$sym} = "Perl_$sym"; + } } + close(FILE); } - close(FILE); } -readembed %embed, $embedfile; +readsyms %embed, @embedsyms; sub skip_these { my $list = shift; |