Overview
Comment: | Fix compilation for AmigaOS 4 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7413f500db8bc5f99ce98933b33a666f |
User & Date: | js on 2018-08-16 22:33:28 |
Other Links: | manifest | tags |
Context
2018-08-17
| ||
01:17 | AmigaOS 4: Do not use libauto check-in: d71abc5366 user: js tags: trunk | |
2018-08-16
| ||
22:33 | Fix compilation for AmigaOS 4 check-in: 7413f500db user: js tags: trunk | |
2018-08-15
| ||
21:37 | OFDNSResolver: Move settings into a single object check-in: 4162178e50 user: js tags: trunk | |
Changes
Modified configure.ac from [86aa9a8c41] to [bc2da8d75f].
︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + + | dnl do not work properly in a library. AC_SUBST(AMIGA_LIB_CFLAGS, "-mcpu=68020 -fbaserel") AC_SUBST(AMIGA_LIB_LDFLAGS, "-mcpu=68020 -fbaserel -resident -nostartfiles") ]) ;; powerpc-*-amigaos*) LIBS="$LIBS -lauto" enable_shared="no" enable_threads="no" ;; *-morphos*) AS_IF([test x"$with_ixemul" != x"yes"], [ AS_IF([test x"$OBJCFLAGS" != x""], [ OBJCFLAGS="$OBJCFLAGS -noixemul" |
︙ |
Modified src/OFApplication.m from [83b9a46140] to [21f22d4085].
︙ | |||
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + | #if defined(OF_MACOS) # include <crt_externs.h> #elif defined(OF_WINDOWS) # include <windows.h> extern int _CRT_glob; extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *); #elif defined(OF_AMIGAOS) # define __USE_INLINE__ # include <proto/exec.h> # include <proto/dos.h> #elif !defined(OF_IOS) extern char **environ; #endif #ifdef OF_PSP |
︙ | |||
288 289 290 291 292 293 294 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | + - + + + + | /* Local variables override global variables */ proc = (struct Process *)FindTask(NULL); firstLocalVar = (struct LocalVar *)proc->pr_LocalVars.mlh_Head; for (struct LocalVar *iter = firstLocalVar; iter->lv_Node.ln_Succ != NULL; iter = (struct LocalVar *)iter->lv_Node.ln_Succ) { # ifdef OF_AMIGAOS4 |
︙ |
Modified src/OFFile.m from [0bea227955] to [41ccc7307b].
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + | #ifdef OF_NINTENDO_DS # include <stdbool.h> # include <filesystem.h> #endif #ifdef OF_AMIGAOS # define __USE_INLINE__ # include <proto/dos.h> #endif #ifndef O_BINARY # define O_BINARY 0 #endif #ifndef O_CLOEXEC |
︙ | |||
270 271 272 273 274 275 276 | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | - + + + + | @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: errNo]; } if (handle->append) { |
︙ | |||
412 413 414 415 416 417 418 | 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | - + + + | #elif defined(OF_AMIGAOS) LONG bytesWritten; if (length > LONG_MAX) @throw [OFOutOfRangeException exception]; if (_handle->append) { |
︙ | |||
487 488 489 490 491 492 493 | 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | - + + + + | default: @throw [OFSeekFailedException exceptionWithStream: self offset: offset whence: whence errNo: EINVAL]; } |
︙ |
Modified src/OFFileManager.m from [b0943bb0f4] to [197757a9e0].
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #ifdef OF_AMIGAOS # define __USE_INLINE__ # include <proto/exec.h> # include <proto/dos.h> # include <proto/locale.h> #endif @interface OFFileManager_default: OFFileManager @end |
︙ |
Modified src/OFLocale.m from [6ed03ca549] to [77de904e6c].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - - - - + - - - - - - - - - - - - - - - - - - - - - - - - | #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFOpenItemFailedException.h" #ifdef OF_AMIGAOS |
︙ |
Modified src/OFStdIOStream.h from [71e9d3c2a0] to [744909e9b5].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + | * file. */ #import "OFStream.h" #import "OFKernelEventObserver.h" #ifdef OF_AMIGAOS |
︙ |
Modified src/OFStdIOStream.m from [5e211fc7f6] to [ecf0064eb3].
︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + + | #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) { |
︙ |
Modified src/OFThread.m from [640ed8051c] to [757dd832c3].
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + | # include <sched.h> #endif #include "unistd_wrapper.h" #include "platform.h" #ifdef OF_AMIGAOS # define __USE_INLINE__ # include <proto/dos.h> #endif #ifdef OF_WII # define nanosleep ogc_nanosleep # include <ogcsys.h> # undef nanosleep |
︙ |
Modified src/OFURLHandler_file.m from [74393b965f] to [78116b7606].
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + + + + | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #ifdef OF_AMIGAOS # define __USE_INLINE__ # include <proto/dos.h> # include <proto/locale.h> # ifdef OF_AMIGAOS4 # define DeleteFile(path) Delete(path) # endif #endif #if defined(OF_WINDOWS) typedef struct __stat64 of_stat_t; #elif defined(OF_AMIGAOS) typedef struct { of_offset_t st_size; |
︙ | |||
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | 107 108 109 110 111 112 113 114 115 116 117 118 119 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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | + + + + + - + + + - + + + + + + + + + + - - - - + + + + + + + + + | static int of_stat(OFString *path, of_stat_t *buffer) { #if defined(OF_WINDOWS) return _wstat64([path UTF16String], buffer); #elif defined(OF_AMIGAOS) BPTR lock; # ifdef OF_AMIGAOS4 struct ExamineData *ed; # else struct FileInfoBlock fib; # endif of_time_interval_t timeInterval; struct Locale *locale; struct DateStamp *date; if ((lock = Lock([path cStringWithEncoding: [OFLocale encoding]], SHARED_LOCK)) == 0) { switch (IoErr()) { case ERROR_OBJECT_IN_USE: case ERROR_DISK_NOT_VALIDATED: errno = EBUSY; break; case ERROR_OBJECT_NOT_FOUND: errno = ENOENT; break; default: errno = 0; break; } return -1; } |
︙ | |||
763 764 765 766 767 768 769 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | - | errNo: EIO]; } @finally { FindClose(handle); } #elif defined(OF_AMIGAOS) of_string_encoding_t encoding = [OFLocale encoding]; BPTR lock; |
︙ | |||
788 789 790 791 792 793 794 795 796 797 798 799 800 801 | 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + | @throw [OFOpenItemFailedException exceptionWithURL: URL mode: nil errNo: errNo]; } @try { # ifdef OF_AMIGAOS4 struct ExamineData *ed; APTR context; if ((context = ObtainDirContextTags(EX_FileLockInput, lock, EX_DoCurrentDir, TRUE, EX_DataFields, EXF_NAME, TAG_END)) == NULL) @throw [OFOpenItemFailedException exceptionWithURL: URL mode: nil errNo: 0]; @try { while ((ed = ExamineDir(context)) != NULL) { OFString *file = [[OFString alloc] initWithCString: ed->Name encoding: encoding]; @try { [files addObject: file]; } @finally { [file release]; } } } @finally { ReleaseDirContext(context); } # else struct FileInfoBlock fib; if (!Examine(lock, &fib)) @throw [OFOpenItemFailedException exceptionWithURL: URL mode: nil errNo: 0]; while (ExNext(lock, &fib)) { |
︙ |