Index: /code/branches/ipv6/src/external/enet/unix.c
===================================================================
--- /code/branches/ipv6/src/external/enet/unix.c	(revision 7432)
+++ /code/branches/ipv6/src/external/enet/unix.c	(revision 7433)
@@ -146,5 +146,5 @@
 
     memset(& hints, 0, sizeof (hints));
-    hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
+    hints.ai_flags = AI_ADDRCONFIG;
     hints.ai_family = AF_UNSPEC;
 
@@ -282,5 +282,5 @@
 
     result = accept (socket, 
-                     address != NULL ? (struct sockaddr *) & sin : NULL, 
+                     address != NULL ? (struct sockaddr *) & sin : NULL,
                      address != NULL ? & sinLength : NULL);
 
@@ -294,6 +294,6 @@
 
     return result;
-} 
-    
+}
+
 void
 enet_socket_destroy (ENetSocket socket)
Index: /code/branches/ipv6/src/external/enet/win32.c
===================================================================
--- /code/branches/ipv6/src/external/enet/win32.c	(revision 7432)
+++ /code/branches/ipv6/src/external/enet/win32.c	(revision 7433)
@@ -67,26 +67,26 @@
 {
     if (family == ENET_IPV4)
-        return sizeof (SOCKADDR_IN);
+        return sizeof (struct sockaddr_in);
     if (family == ENET_IPV6)
-        return sizeof (SOCKADDR_IN6);
+        return sizeof (struct sockaddr_in6);
     return 0;
 }
 
 static ENetAddressFamily
-enet_address_set_address (ENetAddress * address, const SOCKADDR * sin)
+enet_address_set_address (ENetAddress * address, const struct sockaddr * sin)
 {
     memset (address, 0, sizeof (ENetAddress));
     if (sin -> sa_family == AF_INET)
     {
-        address -> host = enet_address_map4 ((((SOCKADDR_IN *) sin) -> sin_addr.s_addr));
+        address -> host = enet_address_map4 ((((struct sockaddr_in *) sin) -> sin_addr.s_addr));
         /* address -> scopeID = 0; */
-        address -> port = ENET_NET_TO_HOST_16 (((SOCKADDR_IN *) sin) -> sin_port);
+        address -> port = ENET_NET_TO_HOST_16 (((struct sockaddr_in *) sin) -> sin_port);
         return ENET_IPV4;
     }
     if (sin -> sa_family == AF_INET6)
     {
-        address -> host = * (ENetHostAddress *) & ((SOCKADDR_IN6 *) sin) -> sin6_addr;
-        address -> scopeID = ((SOCKADDR_IN6 *) sin) -> sin6_scope_id;
-        address -> port = ENET_NET_TO_HOST_16 (((SOCKADDR_IN6 *) sin) -> sin6_port);
+        address -> host = * (ENetHostAddress *) & ((struct sockaddr_in6 *) sin) -> sin6_addr;
+        address -> scopeID = ((struct sockaddr_in6 *) sin) -> sin6_scope_id;
+        address -> port = ENET_NET_TO_HOST_16 (((struct sockaddr_in6 *) sin) -> sin6_port);
         return ENET_IPV6;
     }
@@ -95,5 +95,5 @@
 
 static int
-enet_address_set_sin (SOCKADDR * sin, const ENetAddress * address, ENetAddressFamily family)
+enet_address_set_sin (struct sockaddr * sin, const ENetAddress * address, ENetAddressFamily family)
 {
     memset (sin, 0, enet_sa_size(family));
@@ -102,15 +102,15 @@
       !memcmp (& address -> host, & ENET_HOST_ANY, sizeof(ENetHostAddress))))
     {
-        ((SOCKADDR_IN *) sin) -> sin_family = AF_INET;
-        ((SOCKADDR_IN *) sin) -> sin_addr = * (IN_ADDR *) & address -> host.addr[12];
-        ((SOCKADDR_IN *) sin) -> sin_port = ENET_HOST_TO_NET_16 (address -> port);
+        ((struct sockaddr_in *) sin) -> sin_family = AF_INET;
+        ((struct sockaddr_in *) sin) -> sin_addr = * (struct in_addr *) & address -> host.addr[12];
+        ((struct sockaddr_in *) sin) -> sin_port = ENET_HOST_TO_NET_16 (address -> port);
         return 0;
     }
     else if (family == ENET_IPV6)
     {
-        ((SOCKADDR_IN6 *) sin) -> sin6_family = AF_INET6;
-        ((SOCKADDR_IN6 *) sin) -> sin6_addr = * (IN6_ADDR *) & address -> host;
-        ((SOCKADDR_IN6 *) sin) -> sin6_scope_id = address -> scopeID;
-        ((SOCKADDR_IN6 *) sin) -> sin6_port = ENET_HOST_TO_NET_16 (address -> port);
+        ((struct sockaddr_in6 *) sin) -> sin6_family = AF_INET6;
+        ((struct sockaddr_in6 *) sin) -> sin6_addr = * (struct in6_addr *) & address -> host;
+        ((struct sockaddr_in6 *) sin) -> sin6_scope_id = address -> scopeID;
+        ((struct sockaddr_in6 *) sin) -> sin6_port = ENET_HOST_TO_NET_16 (address -> port);
         return 0;
     }
@@ -122,10 +122,10 @@
 {
     enet_uint16 port = address -> port;
-    ADDRINFO hints;
-    ADDRINFO * result;
-    ADDRINFO * res;
+    struct addrinfo hints;
+    struct addrinfo * result;
+    struct addrinfo * res;
 
     memset(& hints, 0, sizeof (hints));
-    hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
+    hints.ai_flags = AI_ADDRCONFIG;
     hints.ai_family = AF_UNSPEC;
 
@@ -149,8 +149,8 @@
 enet_address_get_host_x (const ENetAddress * address, char * name, size_t nameLength, int flags)
 {
-    SOCKADDR_STORAGE sin;
-    enet_address_set_sin((SOCKADDR *) & sin, address, ENET_IPV6);
-
-    if ( getnameinfo((SOCKADDR *) & sin, enet_sa_size (ENET_IPV6), name, nameLength, NULL, 0, flags))
+    struct sockaddr_storage sin;
+    enet_address_set_sin((struct sockaddr *) & sin, address, ENET_IPV6);
+
+    if ( getnameinfo((struct sockaddr *) & sin, enet_sa_size (ENET_IPV6), name, nameLength, NULL, 0, flags))
         return -1;
 
@@ -173,17 +173,17 @@
 enet_socket_bind (ENetSocket socket, const ENetAddress * address, ENetAddressFamily family)
 {
-    SOCKADDR_STORAGE sin;
+    struct sockaddr_storage sin;
 
     if (address != NULL)
     {
-        enet_address_set_sin((SOCKADDR *) & sin, address, family);
+        enet_address_set_sin((struct sockaddr *) & sin, address, family);
     }
     else
     {
         ENetAddress address_ = { ENET_HOST_ANY_INIT, 0, 0 };
-        enet_address_set_sin((SOCKADDR *) & sin, & address_, family);
-    }
-
-    return bind (socket, (SOCKADDR *) & sin, enet_sa_size(family)) == SOCKET_ERROR ? -1 : 0;
+        enet_address_set_sin((struct sockaddr *) & sin, & address_, family);
+    }
+
+    return bind (socket, (struct sockaddr *) & sin, enet_sa_size(family)) == SOCKET_ERROR ? -1 : 0;
 }
 
@@ -197,5 +197,6 @@
 enet_socket_create (ENetSocketType type, ENetAddressFamily family)
 {
-    return socket (enet_af (family), type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
+    ENetSocket sock = socket (enet_af (family), type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
+    return sock;
 }
 
@@ -238,8 +239,8 @@
 enet_socket_connect (ENetSocket socket, const ENetAddress * address, ENetAddressFamily family)
 {
-    SOCKADDR_STORAGE sin;
-    enet_address_set_sin((SOCKADDR *) & sin, address, family);
-
-    return connect (socket, (SOCKADDR *) & sin, enet_sa_size(family)) == SOCKET_ERROR ? -1 : 0;
+    struct sockaddr_storage sin;
+    enet_address_set_sin((struct sockaddr *) & sin, address, family);
+
+    return connect (socket, (struct sockaddr *) & sin, enet_sa_size (family)) == SOCKET_ERROR ? -1 : 0;
 }
 
@@ -248,9 +249,9 @@
 {
     SOCKET result;
-    SOCKADDR_STORAGE sin;
-    int sinLength = enet_sa_size (family);
+    struct sockaddr_storage sin;
+    socklen_t sinLength = enet_sa_size (family);
 
     result = accept (socket, 
-                     address != NULL ? (SOCKADDR *) & sin : NULL,
+                     address != NULL ? (struct sockaddr *) & sin : NULL,
                      address != NULL ? & sinLength : NULL);
 
@@ -260,5 +261,5 @@
     if (address != NULL)
     {
-        enet_address_set_address(address, (SOCKADDR *) & sin);
+        enet_address_set_address(address, (struct sockaddr *) & sin);
     }
 
@@ -279,10 +280,10 @@
                   ENetAddressFamily family)
 {
-    SOCKADDR_STORAGE sin;
+    struct sockaddr_storage sin;
     DWORD sentLength;
 
     if (address != NULL)
     {
-        enet_address_set_sin((SOCKADDR *) & sin, address, family);
+        enet_address_set_sin((struct sockaddr *) & sin, address, family);
     }
 
@@ -292,5 +293,5 @@
                    & sentLength,
                    0,
-                   address != NULL ? (SOCKADDR *) & sin : 0,
+                   address != NULL ? (struct sockaddr *) & sin : 0,
                    address != NULL ? enet_sa_size (family) : 0,
                    NULL,
@@ -316,5 +317,5 @@
     DWORD flags = 0,
           recvLength;
-    SOCKADDR_STORAGE sin;
+    struct sockaddr_storage sin;
 
     if (WSARecvFrom (socket,
@@ -323,5 +324,5 @@
                      & recvLength,
                      & flags,
-                     address != NULL ? (SOCKADDR *) & sin : NULL,
+                     address != NULL ? (struct sockaddr *) & sin : NULL,
                      address != NULL ? & sinLength : NULL,
                      NULL,
@@ -343,5 +344,5 @@
     if (address != NULL)
     {
-        enet_address_set_address(address, (SOCKADDR *) & sin);
+        enet_address_set_address(address, (struct sockaddr *) & sin);
     }
 
