[Xcb] Win32 port - pls review

Jeetu Golani jeetu.golani at gmail.com
Thu Apr 1 01:07:14 PDT 2010


Hi,

Vincent:
>>you didn't quoted everything or read carefully:  **If** you do

Ah yup :)...sorry I didn't read this carefully.

This makes what Peter said feasible in my opinion i.e we could set errno to
0 and thereby the loop will only be processed once and we can make do with
the #ifdef at the point. For *ix platforms errno will be set in the case of
an error and the code should function normally. Will make the change and
test out the code.

Jamey:
>>Looks like _xcb_open on Win32 could fall off the end without defining a
>>return value. Have you compiled this with warnings turned on?

Yes _xcb_open should have a return value. Will make the change.

Bye for now



On Thu, Apr 1, 2010 at 10:07 AM, Vincent Torri <vtorri at univ-evry.fr> wrote:

>
>
> 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<http://msdn.microsoft.com/en-us/library/ms737828%28VS.85%29.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20100401/ddfa0dbe/attachment.htm>


More information about the Xcb mailing list