@@ -183,11 +183,11 @@ if (address1->address.ss_family != address2->address.ss_family) return false; switch (address1->address.ss_family) { case AF_INET: -#ifndef __wii__ +#ifndef OF_WII if (address1->length < sizeof(struct sockaddr_in) || address2->length < sizeof(struct sockaddr_in)) @throw [OFInvalidArgumentException exception]; #else if (address1->length < 8 || address2->length < 8) @@ -241,11 +241,11 @@ hash += address->address.ss_family; switch (address->address.ss_family) { case AF_INET: -#ifndef __wii__ +#ifndef OF_WII if (address->length < sizeof(struct sockaddr_in)) @throw [OFInvalidArgumentException exception]; #else if (address->length < 8) @throw [OFInvalidArgumentException exception]; @@ -384,11 +384,11 @@ - (uint16_t)bindToHost: (OFString*)host port: (uint16_t)port { of_resolver_result_t **results; -#ifndef __wii__ +#ifndef OF_WII union { struct sockaddr_storage storage; struct sockaddr_in in; # ifdef AF_INET6 struct sockaddr_in6 in6; @@ -395,11 +395,11 @@ # endif } addr; socklen_t addrLen; #endif -#ifdef __wii__ +#ifdef OF_WII if (port == 0) port = of_socket_port_find(SOCK_DGRAM); else if (!of_socket_port_register(port, SOCK_DGRAM)) @throw [OFBindFailedException exceptionWithHost: host port: port @@ -408,11 +408,11 @@ #endif @try { results = of_resolve_host(host, port, SOCK_DGRAM); } @catch (id e) { -#ifdef __wii__ +#ifdef OF_WII of_socket_port_free(port, SOCK_DGRAM); #endif @throw e; } @@ -446,26 +446,26 @@ port: port socket: self errNo: errNo]; } } @catch (id e) { -#ifdef __wii__ +#ifdef OF_WII of_socket_port_free(port, SOCK_DGRAM); #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(); @@ -503,11 +503,11 @@ if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; sender->length = (socklen_t)sizeof(sender->address); -#ifndef _WIN32 +#ifndef OF_WINDOWS if ((ret = recvfrom(_socket, buffer, length, 0, (struct sockaddr*)&sender->address, &sender->length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length @@ -556,11 +556,11 @@ receiver: (const of_udp_socket_address_t*)receiver { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (length > SSIZE_MAX) @throw [OFOutOfRangeException exception]; if (sendto(_socket, buffer, length, 0, (struct sockaddr*)&receiver->address, @@ -588,11 +588,11 @@ [OFRunLoop OF_cancelAsyncRequestsForObject: self]; } - (int)fileDescriptorForReading { -#ifndef _WIN32 +#ifndef OF_WINDOWS return _socket; #else if (_socket == INVALID_SOCKET) return -1; @@ -603,11 +603,11 @@ #endif } - (int)fileDescriptorForWriting { -#ifndef _WIN32 +#ifndef OF_WINDOWS return _socket; #else if (_socket == INVALID_SOCKET) return -1; @@ -624,13 +624,13 @@ @throw [OFNotOpenException exceptionWithObject: self]; close(_socket); _socket = INVALID_SOCKET; -#ifdef __wii__ +#ifdef OF_WII if (_port > 0) { of_socket_port_free(_port, SOCK_DGRAM); _port = 0; } #endif } @end