Use WSAStartup()/WSACleanup() on WIN32
authorRyan Pavlik <rpavlik@iastate.edu>
Wed, 11 Jan 2012 17:06:50 +0000 (18:06 +0100)
committerJulien Danjou <julien@danjou.info>
Wed, 11 Jan 2012 17:07:12 +0000 (18:07 +0100)
commit31b57676e8d7ab6048dbfb145187833fac5e478c
treeed63d3cbea86581cff154f9e226200b8281f394f
parent0e9246def562be97cc816f824f702233a826ec56
Use WSAStartup()/WSACleanup() on WIN32

The alternative is to use these in every WIN32 application which uses xcb. Doing
it this way should be safe, as, according to MSDN, "There must be a call to
WSACleanup for each successful call to WSAStartup. Only the final WSACleanup
function call performs the actual cleanup. The preceding calls simply decrement
an internal reference count"

(We should probably also include ws2_32 in Libs.private for libxcb, as anything
which links with libxcb will also need that, but there seems to be some pkg-config
issues to resolve first...)

v2: Check for errors so WSAStartup()/WSACleanup() uses are balanced
v3: Use same indentation style as surrounding code

Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
src/xcb_conn.c
src/xcb_util.c