Re: Building Windows Server Extensions Using VC++ 2005

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Charles F(dot) I(dot) Savage" <cfis(at)interserv(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Building Windows Server Extensions Using VC++ 2005
Date: 2006-03-04 16:37:12
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0F82E@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Um, is WIN32_CLIENT_ONLY really defined when you're
> building a backend
> > extension? That seems wrong.
>
> Well, it is defined:
>
> #if defined(_MSC_VER) || defined(__BORLANDC__)
> #define WIN32_CLIENT_ONLY
> #endif

Oops. I obviously forgot all about that :-)

> > The whole problem seems to be the using of the pg_config.h
> from mingw
> > when building with msvc. Why not just use the correct
> pg_config.h in
> > the first place? What happens then?
>
> We can't generate a pg_config.h for WIN32_CLIENT_ONLY because
> there is no shell build environment.

Right. But we have include/pg_config.h.win32 which is supposed to be
used in this case. The win32 native build of the backend will copy that
file into pg_config.h.

The problem here is that the backend is built with mingw but the
extension with msvc. If you'd start from fresh, there would be no
pg_config.h to include. The pg_config.h.win32 file is supposed to be
preset for the MSVC environment (which is the same as borland on win32,
but different from mingw).

> > IIRC, there were other problems building extensions with
> MSVC - such
> > as struct alignment and stuff. Not sure if that has been taken care
> > of? If not, there really isn't much point in fixing the
> headers alone
> > :-)
>
> Well, I figure alignment would be based on the CPU, not the
> compiler, but I might be wrong.

Um. struct packing? I don't remember exactly what it was, but IIRC it
was something.

> I added the capability, and why it was added, so if we decide
> the idea is a failure, we know what to remove.

Right. I've never tried using msvc for a server extension, and the
general answer has always been "don't do it". But it may well have
changed now.

//Magnus

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-04 16:48:53 Re: Building Windows Server Extensions Using VC++ 2005
Previous Message Tom Lane 2006-03-04 16:25:24 Re: problem with large maintenance_work_mem settings and