Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -63,10 +63,13 @@ bool _listening; struct sockaddr *_address; socklen_t _addressLength; OFString *_SOCKS5Host; uint16_t _SOCKS5Port; +#ifdef __wii__ + bool _keepAliveEnabled, _TCPNoDelayEnabled; +#endif } #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isListening) bool listening; @property OF_NULLABLE_PROPERTY (copy) OFString *SOCKS5Host; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -592,14 +592,19 @@ if (setsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; + +#ifdef __wii__ + _keepAliveEnabled = enabled; +#endif } - (bool)isKeepAliveEnabled { +#ifndef __wii__ int v; socklen_t len = sizeof(v); if (getsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, &len) != 0 || len != sizeof(v)) @@ -606,10 +611,13 @@ @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; +#else + return _keepAliveEnabled; +#endif } - (void)setTCPNoDelayEnabled: (bool)enabled { int v = enabled; @@ -617,14 +625,19 @@ if (setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; + +#ifdef __wii__ + _TCPNoDelayEnabled = enabled; +#endif } - (bool)isTCPNoDelayEnabled { +#ifndef __wii__ int v; socklen_t len = sizeof(v); if (getsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char*)&v, &len) != 0 || len != sizeof(v)) @@ -631,7 +644,10 @@ @throw [OFGetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; return v; +#else + return _TCPNoDelayEnabled; +#endif } @end Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -33,10 +33,16 @@ #endif #ifdef OF_HAVE_SCHED_YIELD # include #endif + +#ifdef __wii__ +# define BOOL OGC_BOOL +# include +# undef BOOL +#endif #import "OFThread.h" #import "OFThread+Private.h" #import "OFRunLoop.h" #import "OFList.h" @@ -179,11 +185,15 @@ rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000); if (rqtp.tv_sec != floor(timeInterval)) @throw [OFOutOfRangeException exception]; +# ifndef __wii__ nanosleep(&rqtp, NULL); +# else + nanosleep(&rqtp); +# endif #elif defined(OF_NINTENDO_DS) uint64_t counter; if (timeInterval > UINT64_MAX / 60) @throw [OFOutOfRangeException exception]; Index: src/socket_helpers.h ================================================================== --- src/socket_helpers.h +++ src/socket_helpers.h @@ -25,10 +25,12 @@ # include #endif #ifdef HAVE_NETDB_H # include #endif + +#include "socket.h" #ifndef INVALID_SOCKET # define INVALID_SOCKET -1 #endif @@ -66,10 +68,12 @@ # define accept(sock, addr, addrlen) net_accept(sock, addr, addrlen) # define bind(sock, addr, addrlen) net_bind(sock, addr, addrlen) # define close(sock) net_close(sock) # define connect(sock, addr, addrlen) net_connect(sock, addr, addrlen) # define gethostbyname(name) net_gethostbyname(name) +# define h_errno 0 +# define hstrerror(err) "unknown (no hstrerror)" # define listen(sock, backlog) net_listen(sock, backlog) # define poll(fds, nfds, timeout) net_poll(fds, nfds, timeout) # define recv(sock, buf, len, flags) net_recv(sock, buf, len, flags) # define recvfrom(sock, buf, len, flags, addr, addrlen) \ net_recvfrom(sock, buf, len, flags, addr, addrlen) Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -320,11 +320,12 @@ } - (void)applicationDidFinishLaunching { #if defined(__wii__) && defined(OF_HAVE_FILES) - [OFFile changeCurrentDirectoryPath: @"/apps/objfw-tests"]; + [[OFFileManager defaultManager] + changeCurrentDirectoryPath: @"/apps/objfw-tests"]; #endif [self objectTests]; #ifdef OF_HAVE_BLOCKS [self blockTests];