@@ -13,11 +13,10 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #define OF_TCP_SOCKET_M - #define __NO_EXT_QNX #include "config.h" #include @@ -238,11 +237,11 @@ - (void)close { [super close]; -#ifdef __wii__ +#ifdef OF_WII if (_port > 0) { of_socket_port_free(_port, SOCK_STREAM); _port = 0; } #endif @@ -387,11 +386,11 @@ - (uint16_t)bindToHost: (OFString*)host port: (uint16_t)port { of_resolver_result_t **results; const int one = 1; -#ifndef __wii__ +#ifndef OF_WII union { struct sockaddr_storage storage; struct sockaddr_in in; # ifdef AF_INET6 struct sockaddr_in6 in6; @@ -405,11 +404,11 @@ if (_SOCKS5Host != nil) @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; -#ifdef __wii__ +#ifdef OF_WII if (port == 0) port = of_socket_port_find(SOCK_STREAM); else if (!of_socket_port_register(port, SOCK_STREAM)) @throw [OFBindFailedException exceptionWithHost: host port: port @@ -418,11 +417,11 @@ #endif @try { results = of_resolve_host(host, port, SOCK_STREAM); } @catch (id e) { -#ifdef __wii__ +#ifdef OF_WII of_socket_port_free(port, SOCK_STREAM); #endif @throw e; } @@ -459,26 +458,26 @@ port: port socket: self errNo: errNo]; } } @catch (id e) { -#ifdef __wii__ +#ifdef OF_WII of_socket_port_free(port, SOCK_STREAM); #endif @throw e; } @finally { of_resolver_free(results); } if (port > 0) { -#ifdef __wii__ +#ifdef OF_WII _port = port; #endif return port; } -#ifndef __wii__ +#ifndef OF_WII addrLen = (socklen_t)sizeof(addr.storage); if (of_getsockname(_socket, (struct sockaddr*)&addr.storage, &addrLen) != 0) { int errNo = of_socket_errno(); @@ -623,18 +622,18 @@ (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; -#ifdef __wii__ +#ifdef OF_WII _keepAliveEnabled = enabled; #endif } - (bool)isKeepAliveEnabled { -#ifndef __wii__ +#ifndef OF_WII int v; socklen_t len = sizeof(v); if (getsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, &len) != 0 || len != sizeof(v)) @@ -656,18 +655,18 @@ (char*)&v, (socklen_t)sizeof(v)) != 0) @throw [OFSetOptionFailedException exceptionWithStream: self errNo: of_socket_errno()]; -#ifdef __wii__ +#ifdef OF_WII _TCPNoDelayEnabled = enabled; #endif } - (bool)isTCPNoDelayEnabled { -#ifndef __wii__ +#ifndef OF_WII int v; socklen_t len = sizeof(v); if (getsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, (char*)&v, &len) != 0 || len != sizeof(v))