Re: win32 socket definition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: win32 socket definition
Date: 2010-01-01 19:41:10
Message-ID: 18673.1262374870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-01-01 19:45:44 Re: [PATCH] Windows x64 [repost]
Previous Message Tom Lane 2010-01-01 19:33:07 Re: Win64 warnings about size_t