From 07d4e6e86e3167bed18d2af81a56f3d9352d2541 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 19 Oct 2009 20:41:12 +0000 Subject: Make sure the winsock library and pthread library are initialised. --- libxcb/src/xcb_util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libxcb/src') diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c index 55aadb7ca..97642c04d 100644 --- a/libxcb/src/xcb_util.c +++ b/libxcb/src/xcb_util.c @@ -249,6 +249,19 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) } #endif +#ifdef WIN32 + { + static WSADATA wsadata; + + if (!wsadata.wVersion) + { + if (WSAStartup(0x0202, &wsadata)) + return -1; + ptw32_processInitialize(); + } + } +#endif + snprintf(service, sizeof(service), "%hu", port); if(getaddrinfo(host, service, &hints, &results)) /* FIXME: use gai_strerror, and fill in error connection */ -- cgit v1.2.3