From: Gurusamy Sarathy Date: Sun, 22 Nov 1998 11:37:02 +0000 (+0000) Subject: fix broken CAPI generation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=565e2fca1eb6efc2373e28812a12c2d4e3e9470e;p=p5sagit%2Fp5-mst-13.2.git fix broken CAPI generation p4raw-id: //depot/perl@2262 --- diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl index 5c77d70..5972c2a 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 = ) { - 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 () { + 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;