Search Postgresql Archives

Re: Custom C function - is palloc broken?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:
Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> writes:
The other thing I had to do was add include guards on pg_config_os.h to protect against repeat inclusion. VC++ 8.0 does not like the repeated definition of `struct timezone' and `struct itimerval' (but 9.0 - correctly - doesn't care). I have no idea how the standard binaries were built with VC++ without that change

Maybe because it's only included once anyway?

It's included twice if WIN32 is not defined, but you're actually building on win32. WIN32 is defined by all Microsoft build tools EXCEPT Visual Studio Express Edition 2005's default win32 project, which is why 2005 wasn't working but 2008 was.

I'm starting to wonder just how broken the tools you two are using
must be ... and to give thanks once again that I never got sucked
into trying to do development on Windows.

The tools are VERY broken if you're talking about VS Express Edition 2005.

My own Windows development is only reluctant, and only because it's more hassle trying to walk someone through tracking down some insane issue than to just test it myself. It's generally limited to doing occasional test builds of software I'm involved with on windows to make sure it still works. As a result, I'm even worse at Windows development than I am on UNIX.

I avoid working on win32 where possible, because it's horrible. Doubly so with Visual Studio 2005 express, which in its default install is significantly different to what most win32 code expects.

As for "postgres is broken" - I'm not saying that at all. I do think there's a problem with the module magic macros, but it won't stop anything from working (though it might slow down function calls to user modules). I do think `libintl.h' shouldn't be exposed in the public headers if possible - but again, it won't break anything, it's just a cosmetic/usability thing.

I've repeatedly noted that it's highly likely I'm doing something wrong in my build setup.

Well, I was. As well as the issue with the WIN32 macro noted above, I had omitted postgresql/include/server/port/win32 from my header search path (thinking that postgresql/include/server/port/win32_msvc was a replacement, not a supplement). This is what I get for working on these things at stupid-o-clock in the morning.

So:

If using Visual Studio Express Edition 2005, make sure to set WIN32 in the preprocessor definitions (or modify the default project file to set them automatically).

The appropriate header search path is:

include/server
include/server/port/win32_msvc
include/server/port/win32

... and it appears that the examples in the documentation will not work for win32/msvc without a __declspec(dllexport) attribute to ensure that functions are exported, but otherwise work just fine if your build environment is set up correctly.

--
Craig Ringer


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux