ObjFW  Check-in [4258b6f227]

Overview
Comment:Only use AmigaDOS directly when not using ixemul
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4258b6f22743826115aad5015ec6181ddbebc54ee66c2b8f5db1804de543b0e2
User & Date: js on 2017-05-28 12:54:40
Other Links: manifest | tags
Context
2017-05-28
13:36
configure: Add --with-ixemul flag check-in: f1340e44e2 user: js tags: trunk
12:54
Only use AmigaDOS directly when not using ixemul check-in: 4258b6f227 user: js tags: trunk
11:24
Make +[resolve{Class,Instance}Method:] return BOOL check-in: 012c6b5786 user: js tags: trunk
Changes

Modified src/OFStdIOStream.m from [b0cc705195] to [37f14b4e93].

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
# define BOOL EXEC_BOOL
# include <exec/execbase.h>
# include <proto/dos.h>
# undef BOOL

# define INVALID_FD 0
# define getpid() ((int)SysBase->ThisTask)







|







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"

#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
	objc_autoreleasePoolPop(pool);
}

@implementation OFStdIOStream
#ifndef OF_WINDOWS
+ (void)load
{
# 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
	of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: Input()];
	of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: Output()];
	of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: Output()];







|







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
{
# 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
	if (write(_fd, buffer, (int)length) != (int)length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
							     errNo: errno];
#endif
}

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

- (int)fileDescriptorForWriting
{







|







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) || defined(OF_IXEMUL))
- (int)fileDescriptorForReading
{
	return _fd;
}

- (int)fileDescriptorForWriting
{

Modified src/platform.h from [86f686960c] to [d2b1abebc4].

92
93
94
95
96
97
98



99
100
101
102
103
104
105
# define OF_OPENBSD
#elif defined(__DragonFly__)
# define OF_DRAGONFLYBSD
#elif defined(__HAIKU__)
# define OF_HAIKU
#elif defined(__MORPHOS__)
# define OF_MORPHOS



#elif defined(__sun__)
# define OF_SOLARIS
#elif defined(__QNX__)
# define OF_QNX
#elif defined(__wii__)
# define OF_WII
#elif defined(_PSP)







>
>
>







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# define OF_OPENBSD
#elif defined(__DragonFly__)
# define OF_DRAGONFLYBSD
#elif defined(__HAIKU__)
# define OF_HAIKU
#elif defined(__MORPHOS__)
# define OF_MORPHOS
# ifdef __ixemul__
#  define OF_IXEMUL
# endif
#elif defined(__sun__)
# define OF_SOLARIS
#elif defined(__QNX__)
# define OF_QNX
#elif defined(__wii__)
# define OF_WII
#elif defined(_PSP)