X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=1848abc993dfaafad82fed663c52ce2ce6c13deb;hb=bce72f63d2dfb61661f81e305ad3a7db0334403c;hp=996ff251834bbce68a7a6c4bf25b643824e4373c;hpb=53a9834e4cdd11aba8c1cc49347f09a958107de8;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index 996ff25..1848abc 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -27,23 +27,26 @@ #include #include -#include -#include -#include -#include #ifdef DNETCONN #include #include #endif -#include #include #include #include #include #include -#include #include +#ifdef _WIN32 +#include "windefs.h" +#else +#include +#include +#include +#include +#endif /* _WIN32 */ + #include "xcb.h" #include "xcbext.h" #include "xcbint.h" @@ -122,7 +125,9 @@ int xcb_parse_display(const char *name, char **host, int *displayp, } static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port); +#ifndef _WIN32 static int _xcb_open_unix(char *protocol, const char *file); +#endif /* !WIN32 */ #ifdef DNETCONN static int _xcb_open_decnet(const char *host, char *protocol, const unsigned short port); #endif @@ -162,7 +167,7 @@ static int _xcb_open(char *host, char *protocol, const int display) return _xcb_open_tcp(host, protocol, port); } } - +#ifndef _WIN32 /* display specifies Unix socket */ filelen = snprintf(file, sizeof(file), "%s%d", base, display); if(filelen < 0) @@ -176,6 +181,7 @@ static int _xcb_open(char *host, char *protocol, const int display) #endif return _xcb_open_unix(protocol, file); +#endif /* !_WIN32 */ } static int _xcb_socket(int family, int type, int proto) @@ -188,8 +194,10 @@ static int _xcb_socket(int family, int type, int proto) #endif { fd = socket(family, type, proto); +#ifndef _WIN32 if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); +#endif } return fd; } @@ -289,6 +297,7 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) return fd; } +#ifndef _WIN32 static int _xcb_open_unix(char *protocol, const char *file) { int fd; @@ -311,6 +320,7 @@ static int _xcb_open_unix(char *protocol, const char *file) } return fd; } +#endif /* !_WIN32 */ #ifdef HAVE_ABSTRACT_SOCKETS static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen)