ObjFW  Diff

Differences From Artifact [b0cc705195]:

To Artifact [37f14b4e93]:


35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49







-
+







# include "OFStdIOStream_Win32Console.h"
#endif

#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFWriteFailedException.h"

#ifdef OF_MORPHOS
#if defined(OF_MORPHOS) && !defined(OF_IXEMUL)
# define BOOL EXEC_BOOL
# include <exec/execbase.h>
# include <proto/dos.h>
# undef BOOL

# define INVALID_FD 0
# define getpid() ((int)SysBase->ThisTask)
94
95
96
97
98
99
100
101

102
103
104
105
106
107
108
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108







-
+







	objc_autoreleasePoolPop(pool);
}

@implementation OFStdIOStream
#ifndef OF_WINDOWS
+ (void)load
{
# ifndef OF_MORPHOS
# if !defined(OF_MORPHOS) || defined(OF_IXEMUL)
	of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: 0];
	of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: 1];
	of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: 2];
# else
	of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: Input()];
	of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: Output()];
	of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: Output()];
184
185
186
187
188
189
190
191

192
193
194
195
196
197
198
184
185
186
187
188
189
190

191
192
193
194
195
196
197
198







-
+







	if (write(_fd, buffer, (int)length) != (int)length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
							     errNo: errno];
#endif
}

#if !defined(OF_WINDOWS) && !defined(OF_MORPHOS)
#if !defined(OF_WINDOWS) && (!defined(OF_MORPHOS) || defined(OF_IXEMUL))
- (int)fileDescriptorForReading
{
	return _fd;
}

- (int)fileDescriptorForWriting
{