Re: win32 socket definition - Mailing list pgsql-hackers

From Tom Lane
Subject Re: win32 socket definition
Date
Msg-id 18673.1262374870@sss.pgh.pa.us
Whole thread Raw
In response to win32 socket definition  (Magnus Hagander <magnus@hagander.net>)
Responses Re: win32 socket definition  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> The win64 port has showed that we have two sockets declared
> incorrectly. They are supposed to be declared as SOCKET on win32, but
> they are declared as int. See attached patch.

> Given that SOCKET is actually defined as int on win32 (no warnings or
> anything there, just on win64), I'm inclined to apply this patch just
> to HEAD and not bother with backpatching.

This looks pretty bletcherous --- plastering #ifdef WIN32 all over the
code is exactly not the way to be fixing this sort of thing.  Maybe we
should go the other direction of "typedef int SOCKET" on Unix then use
SOCKET everywhere.

BTW, isn't this porting project showing the shortsightedness of using
WIN32 as the its-Windows platform symbol?  The case that you're
worried about here is certainly not "WIN32".
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Win64 warnings about size_t
Next
From: Magnus Hagander
Date:
Subject: Re: [PATCH] Windows x64 [repost]