> > 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 ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq