ObjFW  Diff

Differences From Artifact [ecf0064eb3]:

To Artifact [c5d7e54168]:


32
33
34
35
36
37
38

39
40
41
42
43
44

45



46
47
48
49
50
51
52
53
54
55
56
57






58
59
60
61
62
63
64
65
66
67
68








69
70
71
72
73
74
75
#import "OFStdIOStream+Private.h"
#import "OFDate.h"
#import "OFApplication.h"
#ifdef OF_WINDOWS
# include "OFStdIOStream_Win32Console.h"
#endif


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

#ifdef OF_AMIGAOS

# define __USE_INLINE__



# include <proto/exec.h>
# include <proto/dos.h>
#endif

/* References for static linking */
#ifdef OF_WINDOWS
void
_reference_to_OFStdIOStream_Win32Console(void)
{
	[OFStdIOStream_Win32Console class];
}
#endif







OFStdIOStream *of_stdin = nil;
OFStdIOStream *of_stdout = nil;
OFStdIOStream *of_stderr = nil;

#ifdef OF_AMIGAOS
OF_DESTRUCTOR()
{
	[of_stdin dealloc];
	[of_stdout dealloc];
	[of_stderr dealloc];








}
#endif

void
of_log(OFConstantString *format, ...)
{
	void *pool = objc_autoreleasePoolPush();







>






>
|
>
>
>












>
>
>
>
>
>











>
>
>
>
>
>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#import "OFStdIOStream+Private.h"
#import "OFDate.h"
#import "OFApplication.h"
#ifdef OF_WINDOWS
# include "OFStdIOStream_Win32Console.h"
#endif

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

#ifdef OF_AMIGAOS
# ifdef OF_AMIGAOS4
#  define __USE_INLINE__
#  define __NOLIBBASE__
#  define __NOGLOBALIFACE__
# endif
# include <proto/exec.h>
# include <proto/dos.h>
#endif

/* References for static linking */
#ifdef OF_WINDOWS
void
_reference_to_OFStdIOStream_Win32Console(void)
{
	[OFStdIOStream_Win32Console class];
}
#endif

#ifdef OF_AMIGAOS4
extern struct ExecIFace *IExec;
static struct Library *DOSBase = NULL;
static struct DOSIFace *IDOS = NULL;
#endif

OFStdIOStream *of_stdin = nil;
OFStdIOStream *of_stdout = nil;
OFStdIOStream *of_stderr = nil;

#ifdef OF_AMIGAOS
OF_DESTRUCTOR()
{
	[of_stdin dealloc];
	[of_stdout dealloc];
	[of_stderr dealloc];

# ifdef OF_AMIGAOS4
	if (IDOS != NULL)
		DropInterface(IDOS);

	if (DOSBase != NULL)
		CloseLibrary(DOSBase);
# endif
}
#endif

void
of_log(OFConstantString *format, ...)
{
	void *pool = objc_autoreleasePoolPush();
101
102
103
104
105
106
107
108
109
110
111
112















113
114
115
116
117
118
119
+ (void)load
{
# 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();
	BPTR error = ((struct Process *)FindTask(NULL))->pr_CES;
	bool inputClosable = false, outputClosable = false,
	    errorClosable = false;
















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

	if (output == 0) {
		output = Open("*", MODE_OLDFILE);







|
<



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
+ (void)load
{
# 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, output, error;

	bool inputClosable = false, outputClosable = false,
	    errorClosable = false;

#  ifdef OF_AMIGAOS4
	if ((DOSBase = OpenLibrary("dos.library", 36)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	if ((IDOS = (struct DOSIFace *)
	    GetInterface(DOSBase, "main", 1, NULL)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
#  endif

	input = Input();
	output = Output();
	error = ((struct Process *)FindTask(NULL))->pr_CES;

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

	if (output == 0) {
		output = Open("*", MODE_OLDFILE);