X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=7173db3f72f6ba8407fa668d0f0b20da1bb2c203;hb=68d30adde982f1be33a934707fa105c0db6f7f8f;hp=a55df1624f4bef0fd3d160bb0083857f24938d7a;hpb=769acff0da8b9859ebdf052dce80045465c7598c;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index a55df16..7173db3 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -34,11 +34,11 @@ #include #include #include -#include #ifdef _WIN32 #include "xcb_windefs.h" #else +#include #include #include #include @@ -426,11 +426,22 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, if(!parsed) { c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR); goto out; - } else + } else { +#ifdef _WIN32 + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { + c = _xcb_conn_ret_error(XCB_CONN_ERROR); + goto out; + } +#endif fd = _xcb_open(host, protocol, display); + } if(fd == -1) { c = _xcb_conn_ret_error(XCB_CONN_ERROR); +#ifdef _WIN32 + WSACleanup(); +#endif goto out; }