From: Magnus Hagander Date: Mon, 19 Feb 2007 14:05:42 +0000 (+0000) Subject: Parse pg_proc.h with entries without OIDs. X-Git-Tag: REL8_3_BETA1~1178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc959b7bd2194cc0229d9973484347c4099074e9;p=postgresql Parse pg_proc.h with entries without OIDs. --- diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 9fbb4b9b43..df7f13e140 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -145,7 +145,7 @@ sub GenerateFiles { print H "/* fmgroids.h generated for Visual C++ */\n#ifndef FMGROIDS_H\n#define FMGROIDS_H\n\n"; open(T,">src\\backend\\utils\\fmgrtab.c") || confess "Could not open fmgrtab.c"; print T "/* fmgrtab.c generated for Visual C++ */\n#include \"postgres.h\"\n#include \"utils/fmgrtab.h\"\n\n"; - foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr) { + foreach my $s (sort {intval($a->{oid}) <=> intval($b->{oid})} @fmgr) { next if $seenit{$s->{prosrc}}; $seenit{$s->{prosrc}} = 1; print H "#define F_" . uc $s->{prosrc} . " $s->{oid}\n"; @@ -157,8 +157,9 @@ sub GenerateFiles { my %bmap; $bmap{'t'} = 'true'; $bmap{'f'} = 'false'; - foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr) { - print T " { $s->{oid}, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} },\n"; + foreach my $s (sort {intval($a->{oid}) <=> intval($b->{oid})} @fmgr) { + my $o = intval($s->{oid}); + print T " { $o, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} },\n"; } @@ -231,6 +232,14 @@ EOF } } +sub intval { + my $v = shift; + if ($v =~ /^\d+$/) { + return $v; + } + return 0; +} + sub AddProject { my ($self, $name, $type, $folder, $initialdir) = @_; diff --git a/src/tools/msvc/genbki.pl b/src/tools/msvc/genbki.pl index 7fd0bdd5e6..02aa9c7b4f 100755 --- a/src/tools/msvc/genbki.pl +++ b/src/tools/msvc/genbki.pl @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $PostgreSQL: pgsql/src/tools/msvc/genbki.pl,v 1.3 2007/02/06 09:16:08 petere Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/genbki.pl,v 1.4 2007/02/19 14:05:42 mha Exp $ # #------------------------------------------------------------------------- @@ -80,6 +80,9 @@ foreach my $line (split /\n/, $indata) { if ($#fields >=4 && $fields[0] eq "insert" && $fields[1] eq "OID" && $fields[2] eq "=") { $oid = $fields[3]; } + else { + $oid = 0; + } $data =~ s/\s{2,}/ /g; $bki .= $data . "\n"; }