[Xcb] calling WSAStartup() on Windows

Vincent Torri vtorri at univ-evry.fr
Mon Apr 18 02:41:40 PDT 2011

On Mon, 18 Apr 2011, jeetu.golani at gmail.com wrote:

> Hello Vincent,
> As per what I remember it had been decided that this should be left to the
> calling program to do rather than make it part of libxcb. If I remember
> correctly I had an initWSA function as part of my libxcb port and as per
> recommendations from other developers I had taken it off and we decided that
> WSA init and cleanup be done in the program using libxcb. Thread should be
> in archives somewhere.

well, there still can be some workaround:

adding a xcb_win32_init() function. This is an API addition, which makes 
the write of XCB-based progs consistent with the XCB API

Or we can add 1 member for the xcb_connection_t structure (which is 
available on Windows only, so no ABI break on non-windows platform)

  unsigned char wsa_is_init; /* set to 1 is wsa is alread init */

we init WSA on the connection creation if not alread init. And when we 
close the connection, we call WSACleanup() is init.


More information about the Xcb mailing list