Differences From Artifact [ecf0064eb3]:
- File src/OFStdIOStream.m — part of check-in [7413f500db] at 2018-08-16 22:33:28 on branch trunk — Fix compilation for AmigaOS 4 (user: js, size: 7013) [annotate] [blame] [check-ins using]
To Artifact [c5d7e54168]:
- File
src/OFStdIOStream.m
— part of check-in
[d71abc5366]
at
2018-08-17 01:17:14
on branch trunk
— AmigaOS 4: Do not use libauto
libauto loads the libraries too late. (user: js, size: 7738) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 | #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 | > > | > > > > > > > > > > > > > > > > > | 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 | + (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 | | < > > > > > > > > > > > > > > > | 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); |
︙ | ︙ |