ObjFW  Diff

Differences From Artifact [f28a278b7e]:

To Artifact [26c295bea1]:


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

#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 getpid() ((int)SysBase->ThisTask)
extern struct ExecBase *SysBase;
#endif

/* References for static linking */
#ifdef OF_WINDOWS
void
_reference_to_OFStdIOStream_Win32Console(void)
{







|


<
<







37
38
39
40
41
42
43
44
45
46


47
48
49
50
51
52
53

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

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


#endif

/* References for static linking */
#ifdef OF_WINDOWS
void
_reference_to_OFStdIOStream_Win32Console(void)
{
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
# 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
	BPTR input = Input(), output = Output();
	BPTR error = ((struct Process *)SysBase->ThisTask)->pr_CES;
	bool inputClosable = false, outputClosable = false,
	    errorClosable = false;

	if (input == 0) {
		input = Open("*", MODE_OLDFILE);
		inputClosable = true;
	}







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
# 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
	BPTR input = Input(), output = Output();
	BPTR error = ((struct Process *)FindTask(NULL))->pr_CES;
	bool inputClosable = false, outputClosable = false,
	    errorClosable = false;

	if (input == 0) {
		input = Open("*", MODE_OLDFILE);
		inputClosable = true;
	}