@@ -16,11 +16,13 @@ #define __NO_EXT_QNX #include "config.h" -#ifdef _WIN32 +#include "platform.h" + +#ifdef OF_WINDOWS /* Win32 has a ridiculous default of 64, even though it supports much more. */ # define FD_SETSIZE 1024 #endif #include @@ -43,11 +45,11 @@ @implementation OFKernelEventObserver_select - init { self = [super init]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (_cancelFD[0] >= FD_SETSIZE) @throw [OFInitializationFailedException exception]; #endif FD_ZERO(&_readFDs); @@ -67,11 +69,11 @@ int fd = [object fileDescriptorForReading]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (fd >= FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif if (fd > _maxFD) @@ -85,11 +87,11 @@ int fd = [object fileDescriptorForWriting]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (fd >= FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif if (fd > _maxFD) @@ -105,11 +107,11 @@ int fd = [object fileDescriptorForReading]; if (fd < 0) @throw [OFOutOfRangeException exception]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (fd >= FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif FD_CLR(fd, &_readFDs); @@ -122,11 +124,11 @@ int fd = [object fileDescriptorForWriting]; if (fd < 0) @throw [OFOutOfRangeException exception]; -#ifndef _WIN32 +#ifndef OF_WINDOWS if (fd >= FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif FD_CLR(fd, &_writeFDs); @@ -159,11 +161,11 @@ * We cast to int before assigning to tv_usec in order to avoid a * warning with Apple GCC on PPC. POSIX defines this as suseconds_t, * however, this is not available on Win32. As an int should always * satisfy the required range, we just cast to int. */ -#ifndef _WIN32 +#ifndef OF_WINDOWS timeout.tv_sec = (time_t)timeInterval; #else timeout.tv_sec = (long)timeInterval; #endif timeout.tv_usec = (int)lrint((timeInterval - timeout.tv_sec) * 1000);