Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -364,11 +364,13 @@ - (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port { of_resolver_result_t **results; const int one = 1; +#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) of_socket_address_t address; +#endif if (_socket != INVALID_SOCKET) @throw [OFAlreadyConnectedException exceptionWithSocket: self]; if (_SOCKS5Host != nil) Index: src/OFUDPSocket.m ================================================================== --- src/OFUDPSocket.m +++ src/OFUDPSocket.m @@ -330,11 +330,13 @@ - (uint16_t)bindToHost: (OFString *)host port: (uint16_t)port { of_resolver_result_t **results; +#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) of_socket_address_t address; +#endif results = of_resolve_host(host, port, SOCK_DGRAM); @try { #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) int flags; Index: src/socket.h ================================================================== --- src/socket.h +++ src/socket.h @@ -72,10 +72,14 @@ #ifndef OF_WINDOWS typedef int of_socket_t; #else typedef SOCKET of_socket_t; #endif + +#ifdef OF_WII +typedef u8 sa_family_t; +#endif /*! * @enum of_socket_address_type_t socket.h ObjFW/socket.h */ typedef enum { Index: src/socket.m ================================================================== --- src/socket.m +++ src/socket.m @@ -535,11 +535,11 @@ maxZerosStart = zerosStart; maxZerosCount = zerosCount; } if (maxZerosCount >= 2) { - for (uint_fast8_t i = 0; i < maxZerosStart; i += 2) { + for (int_fast8_t i = 0; i < maxZerosStart; i += 2) { [string appendFormat: (first ? @"%x" : @":%x"), (addrIn6->sin6_addr.s6_addr[i] << 8) | addrIn6->sin6_addr.s6_addr[i + 1]]; first = false; @@ -546,11 +546,11 @@ } [string appendString: @"::"]; first = true; - for (uint_fast8_t i = maxZerosStart + (maxZerosCount * 2); + for (int_fast8_t i = maxZerosStart + (maxZerosCount * 2); i < 16; i += 2) { [string appendFormat: (first ? @"%x" : @":%x"), (addrIn6->sin6_addr.s6_addr[i] << 8) | addrIn6->sin6_addr.s6_addr[i + 1]]; Index: src/socket_helpers.h ================================================================== --- src/socket_helpers.h +++ src/socket_helpers.h @@ -85,12 +85,12 @@ net_recvfrom(sock, buf, len, flags, addr, addrlen) # define select(nfds, readfds, writefds, errorfds, timeout) \ net_select(nfds, readfds, writefds, errorfds, timeout) # define send(sock, buf, len, flags) net_send(sock, buf, len, flags) # define sendto(sock, buf, len, flags, addr, addrlen) \ - net_sendto(sock, buf, len, flags, addr, addrlen) + net_sendto(sock, buf, len, flags, (struct sockaddr *)(addr), addrlen) # define setsockopt(sock, level, name, value, len) \ net_setsockopt(sock, level, name, value, len) # define socket(domain, type, proto) net_socket(domain, type, proto) typedef u32 in_addr_t; typedef u32 nfds_t; #endif