Re: Fix Windows socket error checking for MinGW

From: Michael Cronenworth <mike(at)cchtml(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix Windows socket error checking for MinGW
Date: 2013-08-19 13:46:11
Message-ID: 521221A3.1010404@cchtml.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/17/2013 12:16 AM, Noah Misch wrote:
> 1. Redefine those constants for more (all?) compilers.
> 2. Remove that block and put #ifdef around all usage of such constants in
> frontend code, as you have done.
> 3. Remove that block and make src/backend/port/win32/socket.c frontend-usable,
> so frontend code can treat errno like backend code treats errno.
>
> What do you recommend?

Option 1 is dangerous. I'd rather let the environments keep their constants.

Option 2 is the least dangerous but it adds lines of code.

Option 3: The errno variable is not set in Windows so relying on it is not possible.

If no one likes my patch then you need to come up with your own constants (ex.
PG_EINPROGRESS) and define those based on the compiler environment.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Cronenworth 2013-08-19 13:50:12 Re: Fix Windows socket error checking for MinGW
Previous Message Andrew Dunstan 2013-08-19 13:42:08 Re: Automatic Index Creation for Column Types