Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Custom C fu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 17 of 23 Topic 15452 of 16557
Post > Topic >>

Re: Custom C function - is palloc broken?

by craig@[EMAIL PROTECTED] (Craig Ringer) May 6, 2008 at 12:02 PM

Tom Lane wrote:
> Craig Ringer <craig@[EMAIL PROTECTED]
> 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/****t/win32 from my header search 
path (thinking that postgresql/include/server/****t/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/****t/win32_msvc
include/server/****t/win32

.... and it appears that the examples in the do***entation will not work 
for win32/msvc without a __declspec(dllex****t) attribute to ensure that 
functions are ex****ted, but otherwise work just fine if your build 
environment is set up correctly.

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 23 Posts in Topic:
Custom C function - is palloc broken?
n8thatcher@[EMAIL PROTECT  2008-05-03 21:39:04 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-04 23:50:26 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-04 23:52:41 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-04 13:02:49 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-05 05:53:27 
Re: Custom C function - is palloc broken?
magnus@[EMAIL PROTECTED]   2008-05-04 21:15:49 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-05 06:47:11 
Re: Custom C function - is palloc broken?
n8thatcher@[EMAIL PROTECT  2008-05-04 21:53:01 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-05 15:54:13 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-05 09:26:22 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-05 16:57:08 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-05 18:47:50 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-06 08:42:16 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-05 19:42:01 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-06 10:19:32 
Re: Custom C function - is palloc broken?
tgl@[EMAIL PROTECTED] (T  2008-05-05 22:32:11 
Re: Custom C function - is palloc broken?
craig@[EMAIL PROTECTED]   2008-05-06 12:02:28 
Re: Custom C function - is palloc broken?
heron@[EMAIL PROTECTED]   2008-05-05 20:45:05 
Re: Custom C function - is palloc broken?
jd@[EMAIL PROTECTED] (&q  2008-05-05 20:18:42 
Re: Custom C function - is palloc broken?
tgl@[EMAIL PROTECTED] (T  2008-05-05 22:22:43 
Re: Custom C function - is palloc broken?
magnus@[EMAIL PROTECTED]   2008-05-05 09:07:37 
Re: Custom C function - is palloc broken?
dpage@[EMAIL PROTECTED]   2008-05-06 09:46:14 
Re: Custom C function - is palloc broken?
dpage@[EMAIL PROTECTED]   2008-05-06 09:48:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 13:29:35 CDT 2008.