Re: Fix Windows socket error checking for MinGW - Mailing list pgsql-hackers

From Michael Cronenworth
Subject Re: Fix Windows socket error checking for MinGW
Date
Msg-id 521221A3.1010404@cchtml.com
Whole thread Raw
In response to Re: Fix Windows socket error checking for MinGW  (Noah Misch <noah@leadboat.com>)
Responses Re: Fix Windows socket error checking for MinGW  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Fix Windows socket error checking for MinGW  (Noah Misch <noah@leadboat.com>)
List 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.



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Automatic Index Creation for Column Types
Next
From: Michael Cronenworth
Date:
Subject: Re: Fix Windows socket error checking for MinGW