@@ -67,11 +67,11 @@ #endif #ifndef O_EXLOCK # define O_EXLOCK 0 #endif -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS # define closeHandle(h) close(h) #else static OFDataArray *openHandles = nil; static void @@ -98,11 +98,11 @@ for (size_t i = 0; i < count; i++) Close(handles[i]); } #endif -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS static int parseMode(const char *mode) { if (strcmp(mode, "r") == 0) return O_RDONLY; @@ -190,11 +190,11 @@ + (void)initialize { if (self != [OFFile class]) return; -#if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +#ifdef OF_MORPHOS openHandles = [[OFDataArray alloc] initWithItemSize: sizeof(BPTR)]; #endif #ifdef OF_WII if (!fatInitDefault()) @@ -233,11 +233,11 @@ @try { void *pool = objc_autoreleasePoolPush(); int flags; -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS if ((flags = parseMode([mode UTF8String])) == -1) @throw [OFInvalidArgumentException exception]; flags |= O_CLOEXEC; @@ -329,11 +329,11 @@ if ((ret = read(_handle, buffer, (unsigned int)length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: errno]; -#elif defined(OF_MORPHOS) && !defined(OF_IXEMUL) +#elif defined(OF_MORPHOS) if (length > LONG_MAX) @throw [OFOutOfRangeException exception]; if ((ret = Read(_handle.handle, buffer, length)) < 0) @throw [OFReadFailedException exceptionWithObject: self @@ -364,11 +364,11 @@ if (write(_handle, buffer, (int)length) != (int)length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length errNo: errno]; -#elif defined(OF_MORPHOS) && !defined(OF_IXEMUL) +#elif defined(OF_MORPHOS) if (length > LONG_MAX) @throw [OFOutOfRangeException exception]; if (_handle.append) { if (Seek64(_handle.handle, 0, OFFSET_END) == -1) @@ -399,11 +399,11 @@ if (!OF_FILE_HANDLE_IS_VALID(_handle)) @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence]; -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS # if defined(OF_WINDOWS) ret = _lseeki64(_handle, offset, whence); # elif defined(OF_HAVE_OFF64_T) ret = lseek64(_handle, offset, whence); # else