diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index d4e5435e..717f6c02 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -402,17 +402,22 @@ libwebsockets_get_peer_addresses(int fd, char *name, int name_len, p = (unsigned char *)host1->h_addr_list[n++]; if (p == NULL) continue; - if ((host1->h_addrtype != AF_INET) && - (host1->h_addrtype != AF_LOCAL)) + if ((host1->h_addrtype != AF_INET) +#ifdef AF_LOCAL + && (host1->h_addrtype != AF_LOCAL) +#endif + ) continue; if (host1->h_addrtype == AF_INET) sprintf(ip, "%u.%u.%u.%u", p[0], p[1], p[2], p[3]); +#ifdef AF_LOCAL else { un = (struct sockaddr_un *)p; strncpy(ip, un->sun_path, sizeof(ip) -1); ip[sizeof(ip) - 1] = '\0'; } +#endif p = NULL; strncpy(rip, ip, rip_len); rip[rip_len - 1] = '\0'; diff --git a/win32port/win32helpers/websock-w32.h b/win32port/win32helpers/websock-w32.h index 8b2ebe58..88222ab6 100644 --- a/win32port/win32helpers/websock-w32.h +++ b/win32port/win32helpers/websock-w32.h @@ -7,11 +7,15 @@ #define DEBUG 1 #endif +#pragma warning(disable : 4996) + #define bzero(b,len) (memset((b), '\0', (len)), (void) 0) #define MSG_NOSIGNAL 0 #define SHUT_RDWR SD_BOTH +#define SOL_TCP IPPROTO_TCP + #define random rand #define usleep _sleep #define poll WSAPoll