Skip to content

Commit bc959b7

Browse files
committed
Parse pg_proc.h with entries without OIDs.
1 parent 7c5e543 commit bc959b7

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/tools/msvc/Solution.pm

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ sub GenerateFiles {
145145
print H "/* fmgroids.h generated for Visual C++ */\n#ifndef FMGROIDS_H\n#define FMGROIDS_H\n\n";
146146
open(T,">src\\backend\\utils\\fmgrtab.c") || confess "Could not open fmgrtab.c";
147147
print T "/* fmgrtab.c generated for Visual C++ */\n#include \"postgres.h\"\n#include \"utils/fmgrtab.h\"\n\n";
148-
foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr) {
148+
foreach my $s (sort {intval($a->{oid}) <=> intval($b->{oid})} @fmgr) {
149149
next if $seenit{$s->{prosrc}};
150150
$seenit{$s->{prosrc}} = 1;
151151
print H "#define F_" . uc $s->{prosrc} . " $s->{oid}\n";
@@ -157,8 +157,9 @@ sub GenerateFiles {
157157
my %bmap;
158158
$bmap{'t'} = 'true';
159159
$bmap{'f'} = 'false';
160-
foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr) {
161-
print T " { $s->{oid}, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} },\n";
160+
foreach my $s (sort {intval($a->{oid}) <=> intval($b->{oid})} @fmgr) {
161+
my $o = intval($s->{oid});
162+
print T " { $o, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} },\n";
162163
}
163164

164165

@@ -231,6 +232,14 @@ EOF
231232
}
232233
}
233234

235+
sub intval {
236+
my $v = shift;
237+
if ($v =~ /^\d+$/) {
238+
return $v;
239+
}
240+
return 0;
241+
}
242+
234243
sub AddProject {
235244
my ($self, $name, $type, $folder, $initialdir) = @_;
236245

src/tools/msvc/genbki.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
#
1313
# IDENTIFICATION
14-
# $PostgreSQL: pgsql/src/tools/msvc/genbki.pl,v 1.3 2007/02/06 09:16:08 petere Exp $
14+
# $PostgreSQL: pgsql/src/tools/msvc/genbki.pl,v 1.4 2007/02/19 14:05:42 mha Exp $
1515
#
1616
#-------------------------------------------------------------------------
1717

@@ -80,6 +80,9 @@
8080
if ($#fields >=4 && $fields[0] eq "insert" && $fields[1] eq "OID" && $fields[2] eq "=") {
8181
$oid = $fields[3];
8282
}
83+
else {
84+
$oid = 0;
85+
}
8386
$data =~ s/\s{2,}/ /g;
8487
$bki .= $data . "\n";
8588
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy