]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/inet_pton.c
Use <pulsecore/socket.h> instead of <sys/socket.h>
[pulseaudio] / src / pulsecore / inet_pton.c
index d191e5507343c71a10abfa91b045fbb9c44ef4f8..198d1a0d830695db61867bcfee55cc732061f6a8 100644 (file)
 
 #ifndef HAVE_INET_PTON
 
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#include "winsock.h"
+#include <pulsecore/socket.h>
 
 #include "inet_pton.h"
 
 int inet_pton(int af, const char *src, void *dst) {
     struct in_addr *in = (struct in_addr*)dst;
+#ifdef HAVE_IPV6
     struct in6_addr *in6 = (struct in6_addr*)dst;
+#endif
 
     assert(src && dst);
 
@@ -48,8 +46,10 @@ int inet_pton(int af, const char *src, void *dst) {
         if (in->s_addr == INADDR_NONE)
             return 0;
         break;
+#ifdef HAVE_IPV6
     case AF_INET6:
         /* FIXME */
+#endif
     default:
         errno = EAFNOSUPPORT;
         return -1;