Re: Gist does not build with VC++ anymore

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
Subject: Re: Gist does not build with VC++ anymore
Date: 2006-06-24 17:15:45
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FA8C@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I've updated my VC++ build env with latest CVS, and it no
> longer builds because of changes to GIST:
>
> src\backend\access\gist\gistutil.c(237) : error C2057:
> expected constant expression
> src\backend\access\gist\gistutil.c(237) : error C2466: cannot
> allocate an array of constant size 0
> src\backend\access\gist\gistutil.c(237) : error C2133: 'storage' :
> unknown size
>
>
> The problem appears to come from:
> #define GEVHDRSZ (offsetof(GistEntryVector, vector[0]))
>
> Which can't be used in this context.
>
> What would be the proper fix for that?

Hmm. Now that I look at it more clearly, it seems Hiroshi has a fix for
this in his submitted patch (that still had a lot of other problems in
the rest of it). I'm not sure if it's the proper fix, but it's there.
Comments on it?

--- src/backend/access/gist/gistutil.c.orig Thu Jun 22 20:46:55 2006
+++ src/backend/access/gist/gistutil.c Thu Jun 22 20:47:22 2006
@@ -228,6 +228,12 @@
/*
* makes union of two key
*/
+
+#ifdef _MSC_VER
+#undef GEVHDRSZ
+#define GEVHDRSZ (offsetof(GistEntryVector, vector))
+#endif
+
static void
gistMakeUnionKey( GISTSTATE *giststate, int attno,
GISTENTRY *entry1, bool
isnull1,

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2006-06-24 17:23:01 Re: Gist does not build with VC++ anymore
Previous Message PFC 2006-06-24 16:59:24 Re: vacuum, performance, and MVCC