@@ -37,11 +37,11 @@ #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" -#if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +#ifdef OF_MORPHOS # define BOOL EXEC_BOOL # include # undef BOOL #endif @@ -56,11 +56,11 @@ OFStdIOStream *of_stdin = nil; OFStdIOStream *of_stdout = nil; OFStdIOStream *of_stderr = nil; -#if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +#ifdef OF_MORPHOS OF_DESTRUCTOR() { [of_stdin dealloc]; [of_stdout dealloc]; [of_stderr dealloc]; @@ -92,11 +92,11 @@ @implementation OFStdIOStream #ifndef OF_WINDOWS + (void)load { -# if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +# ifndef OF_MORPHOS of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: 2]; # else BPTR input = Input(), output = Output(); @@ -132,11 +132,11 @@ - init { OF_INVALID_INIT_METHOD } -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS - (instancetype)of_initWithFileDescriptor: (int)fd { self = [super init]; _fd = fd; @@ -163,11 +163,11 @@ [super dealloc]; } - (bool)lowlevelIsAtEndOfStream { -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS if (_fd == -1) return true; #else if (_handle == 0) return true; @@ -179,11 +179,11 @@ - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS if (_fd == -1 || _atEndOfStream) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length]; # ifndef OF_WINDOWS @@ -220,11 +220,11 @@ } - (void)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS if (_fd == -1 || _atEndOfStream) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; # ifndef OF_WINDOWS @@ -256,11 +256,11 @@ @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length]; #endif } -#if !defined(OF_WINDOWS) && (!defined(OF_MORPHOS) || defined(OF_IXEMUL)) +#if !defined(OF_WINDOWS) && !defined(OF_MORPHOS) - (int)fileDescriptorForReading { return _fd; } @@ -270,11 +270,11 @@ } #endif - (void)close { -#if !defined(OF_MORPHOS) || defined(OF_IXEMUL) +#ifndef OF_MORPHOS if (_fd != -1) close(_fd); _fd = -1; #else @@ -306,12 +306,11 @@ return OF_RETAIN_COUNT_MAX; } - (int)columns { -#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && \ - (!defined(OF_MORPHOS) || defined(OF_IXEMUL)) +#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_MORPHOS) struct winsize ws; if (ioctl(_fd, TIOCGWINSZ, &ws) != 0) return -1; @@ -321,12 +320,11 @@ #endif } - (int)rows { -#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && \ - (!defined(OF_MORPHOS) || defined(OF_IXEMUL)) +#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_MORPHOS) struct winsize ws; if (ioctl(_fd, TIOCGWINSZ, &ws) != 0) return -1;