Re: WIN32 errno patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIN32 errno patch
Date
Msg-id 5525.997391902@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIN32 errno patch  (Ian Lance Taylor <ian@airs.com>)
Responses Re: WIN32 errno patch
List pgsql-hackers
Ian Lance Taylor <ian@airs.com> writes:
> I think the clean way to handle this is something along the lines of
> what the CVS client does.  On Unix, do this:
>     #define SOCK_ERRNO errno
>     #define SOCK_STRERROR strerror
> On Windows, do this:
>     #define SOCK_ERRNO (WSAGetLastError ())
>     #define SOCK_STRERROR sock_strerror

I've been trying to avoid uglifying the code like that, but perhaps
we have no choice :-(.

> (Then you have to write sock_strerror.)

Surely Windows provides a suitable function?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Ian Lance Taylor
Date:
Subject: Re: WIN32 errno patch
Next
From: "Magnus Naeslund\(f\)"
Date:
Subject: Re: Re: WIN32 errno patch