Re: Building Windows Server Extensions Using VC++ 2005

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Building Windows Server Extensions Using VC++ 2005
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCEA0F82E@algol.sollentuna.se
обсуждение исходный текст
Ответ на Building Windows Server Extensions Using VC++ 2005  (Charlie Savage <cfis@interserv.com>)
Ответы Re: Building Windows Server Extensions Using VC++ 2005  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: problem with large maintenance_work_mem settings and
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Building Windows Server Extensions Using VC++ 2005