[Xcb] Win32 port - pls review
Vincent Torri
vtorri at univ-evry.fr
Wed Mar 31 21:37:49 PDT 2010
On Thu, 1 Apr 2010, Jeetu Golani wrote:
>
> Hi,
>
>> Fine with me, but I thought there were platforms where you can't assign
>> to errno--in fact, I thought Win32 was one of those platforms?
>
> While mingw doesn't seem to complain if we assign errno = 0, this article on
> msdn suggests applications can't (or maybe shouldn't?)
>
> http://msdn.microsoft.com/en-us/library/ms737828(VS.85).aspx
>
> <Quote>
> Furthermore, it is not possible for an application to assign a new value to
> errno. (In Windows Sockets, the function WSASetLastError may be used for
> this purpose.)
> </Unquote>
you didn't quoted everything or read carefully: **If** you do
#define errno WSAGetLastError()
then you can't set a value to errno as it's not an lvalue anymore. errno
is a global variable and can, of course, be set if no strange define like
above is done
if you use socket functions on Windows, WSASetLastError() and
WSAGetLastError() should be used to set / get errors, like errno for CRT
Vincent
More information about the Xcb
mailing list