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";
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";
}
}
}
+sub intval {
+ my $v = shift;
+ if ($v =~ /^\d+$/) {
+ return $v;
+ }
+ return 0;
+}
+
sub AddProject {
my ($self, $name, $type, $folder, $initialdir) = @_;
#
#
# 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 $
#
#-------------------------------------------------------------------------
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";
}