diff options
Diffstat (limited to 'libxcb/src/xcb_auth.c')
-rw-r--r-- | libxcb/src/xcb_auth.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libxcb/src/xcb_auth.c b/libxcb/src/xcb_auth.c index 859ab8a76..aeb2374ed 100644 --- a/libxcb/src/xcb_auth.c +++ b/libxcb/src/xcb_auth.c @@ -30,7 +30,9 @@ #include <sys/param.h> #include <unistd.h> #include <stdlib.h> +#ifndef _MSC_VER #include <arpa/inet.h> +#endif #ifdef __INTERIX /* _don't_ ask. interix has INADDR_LOOPBACK in here. */ @@ -256,13 +258,14 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * /* `sockaddr_un.sun_path' typical size usually ranges between 92 and 108 */ #define INITIAL_SOCKNAME_SLACK 108 +#ifndef WIN32 +typedef int (*LPFN_GETPEERNAME)(int,struct sockaddr *,socklen_t *); +#endif /* Return a dynamically allocated socket address structure according to the value returned by either getpeername() or getsockname() (according to POSIX, applications should not assume a particular length for `sockaddr_un.sun_path') */ -static struct sockaddr *get_peer_sock_name(int (*socket_func)(int, - struct sockaddr *, - socklen_t *), +static struct sockaddr *get_peer_sock_name(LPFN_GETPEERNAME socket_func, int fd) { socklen_t socknamelen = sizeof(struct sockaddr) + INITIAL_SOCKNAME_SLACK; |