@@ -39,11 +39,14 @@ #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" -#ifdef OF_MORPHOS +#ifdef OF_AMIGAOS +# ifdef OF_AMIGAOS3 +# define INTUITION_CLASSES_H +# endif # include #endif /* References for static linking */ #ifdef OF_WINDOWS @@ -56,11 +59,11 @@ OFStdIOStream *of_stdin = nil; OFStdIOStream *of_stdout = nil; OFStdIOStream *of_stderr = nil; -#ifdef OF_MORPHOS +#ifdef OF_AMIGAOS OF_DESTRUCTOR() { [of_stdin dealloc]; [of_stdout dealloc]; [of_stderr dealloc]; @@ -96,11 +99,11 @@ @implementation OFStdIOStream #ifndef OF_WINDOWS + (void)load { -# ifndef OF_MORPHOS +# ifndef OF_AMIGAOS 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(); @@ -136,11 +139,11 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -#ifndef OF_MORPHOS +#ifndef OF_AMIGAOS - (instancetype)of_initWithFileDescriptor: (int)fd { self = [super init]; _fd = fd; @@ -167,11 +170,11 @@ [super dealloc]; } - (bool)lowlevelIsAtEndOfStream { -#ifndef OF_MORPHOS +#ifndef OF_AMIGAOS if (_fd == -1) #else if (_handle == 0) #endif @throw [OFNotOpenException exceptionWithObject: self]; @@ -182,11 +185,11 @@ - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; -#ifndef OF_MORPHOS +#ifndef OF_AMIGAOS if (_fd == -1) @throw [OFNotOpenException exceptionWithObject: self]; # ifndef OF_WINDOWS if ((ret = read(_fd, buffer, length)) < 0) @@ -222,11 +225,11 @@ } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { -#ifndef OF_MORPHOS +#ifndef OF_AMIGAOS if (_fd == -1) @throw [OFNotOpenException exceptionWithObject: self]; # ifndef OF_WINDOWS ssize_t bytesWritten; @@ -268,11 +271,11 @@ #endif return (size_t)bytesWritten; } -#if !defined(OF_WINDOWS) && !defined(OF_MORPHOS) +#if !defined(OF_WINDOWS) && !defined(OF_AMIGAOS) - (int)fileDescriptorForReading { return _fd; } @@ -282,11 +285,11 @@ } #endif - (void)close { -#ifndef OF_MORPHOS +#ifndef OF_AMIGAOS if (_fd != -1) close(_fd); _fd = -1; #else @@ -318,11 +321,11 @@ return OF_RETAIN_COUNT_MAX; } - (int)columns { -#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_MORPHOS) +#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_AMIGAOS) struct winsize ws; if (ioctl(_fd, TIOCGWINSZ, &ws) != 0) return -1; @@ -332,11 +335,11 @@ #endif } - (int)rows { -#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_MORPHOS) +#if defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ) && !defined(OF_AMIGAOS) struct winsize ws; if (ioctl(_fd, TIOCGWINSZ, &ws) != 0) return -1;