Unix Technical Forum

zic with msvc

This is a discussion on zic with msvc within the Pgsql Patches forums, part of the PostgreSQL category; --> Attached patch is required to make zic build on msvc. It enables Windows NT4 and newer functions in the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 09:05 AM
Magnus Hagander
 
Posts: n/a
Default zic with msvc

Attached patch is required to make zic build on msvc. It enables Windows
NT4 and newer functions in the windows API, so we can use CopyFileEx.

//Magnus



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 09:05 AM
Tom Lane
 
Posts: n/a
Default Re: zic with msvc

"Magnus Hagander" <mha@sollentuna.net> writes:
> + #ifdef WIN32
> + #define _WIN32_WINNT 0x0400
> + #endif


Hmm ... in pg_ctl.c I see

#define _WIN32_WINNT 0x0500

Is there a reason for these to be different? Are there other places
that will need this (ie, maybe it should be in c.h instead?)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:05 AM
Magnus Hagander
 
Posts: n/a
Default Re: zic with msvc

> > + #ifdef WIN32
> > + #define _WIN32_WINNT 0x0400
> > + #endif

>
> Hmm ... in pg_ctl.c I see
>
> #define _WIN32_WINNT 0x0500
>
> Is there a reason for these to be different? Are there other
> places that will need this (ie, maybe it should be in c.h instead?)


Not really. The default appears to be 0x0400 for MingW (or it wouldn't
have worked before), but 0x0350 or so for Visual C++.
If we define it to 0x0500 we pull in headers that will only work on 2000
or newer. But I don't really see that as a problem - I think we said
that we don't care about earlier ones anyway. in which case it's
definitly not a problem to stick it in c.h.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 09:05 AM
Tom Lane
 
Posts: n/a
Default Re: [HACKERS] zic with msvc

"Magnus Hagander" <mha@sollentuna.net> writes:
>>> + #ifdef WIN32
>>> + #define _WIN32_WINNT 0x0400
>>> + #endif

>>
>> Hmm ... in pg_ctl.c I see
>>
>> #define _WIN32_WINNT 0x0500
>>
>> Is there a reason for these to be different? Are there other
>> places that will need this (ie, maybe it should be in c.h instead?)


> Not really. The default appears to be 0x0400 for MingW (or it wouldn't
> have worked before), but 0x0350 or so for Visual C++.
> If we define it to 0x0500 we pull in headers that will only work on 2000
> or newer.


Hm. Actually, if the rest of the backend compiles without this, then
I guess the real question is what's zic.c doing that needs it? pg_ctl.c
has an excuse because it's doing weird MS-specific junk, but zic.c is
supposed to be bog-standard portable code. It really shouldn't have
anything that's further out there than you could find in ten other
places in the backend.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 09:05 AM
Magnus Hagander
 
Posts: n/a
Default Re: [HACKERS] zic with msvc

> >>> + #ifdef WIN32
> >>> + #define _WIN32_WINNT 0x0400
> >>> + #endif
> >>
> >> Hmm ... in pg_ctl.c I see
> >>
> >> #define _WIN32_WINNT 0x0500
> >>
> >> Is there a reason for these to be different? Are there

> other places
> >> that will need this (ie, maybe it should be in c.h instead?)

>
> > Not really. The default appears to be 0x0400 for MingW (or

> it wouldn't
> > have worked before), but 0x0350 or so for Visual C++.
> > If we define it to 0x0500 we pull in headers that will only work on
> > 2000 or newer.

>
> Hm. Actually, if the rest of the backend compiles without
> this, then I guess the real question is what's zic.c doing
> that needs it? pg_ctl.c has an excuse because it's doing
> weird MS-specific junk, but zic.c is supposed to be
> bog-standard portable code. It really shouldn't have
> anything that's further out there than you could find in ten
> other places in the backend.


Only almost. There is a small function to emulate link(), which uses
CopyFileEx(). That's the one.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:37 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com