Comment: | runtime: Define BOOL to be the same as bool
As we define the ABI, we can just replace BOOL with bool everywhere, This still defines BOOL to bool for compatibility, except on AmigaOS and |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
fe2cbe0021d3ead13b86293e21ff1a13 |
User & Date: | js on 2018-04-22 16:13:04 |
Other Links: | manifest | tags |
2018-04-22
| ||
17:48 | Make ObjFW compile for AmigaOS 3 check-in: 0b07c8fcfa user: js tags: trunk | |
16:13 | runtime: Define BOOL to be the same as bool check-in: fe2cbe0021 user: js tags: trunk | |
2018-04-15
| ||
19:15 | ObjFW.h: Fix conditional for OFHTTPClient import check-in: 4bc1aa6831 user: js tags: trunk | |
Modified src/OFApplication.m from [240e542914] to [8777ac3750].
︙ | ︙ | |||
49 50 51 52 53 54 55 | # 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_MORPHOS) | < < | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # 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_MORPHOS) # include <proto/exec.h> # include <proto/dos.h> #elif !defined(OF_IOS) extern char **environ; #endif #ifdef OF_PSP # include <pspkerneltypes.h> # include <psploadexec.h> |
︙ | ︙ |
Modified src/OFFile.h from [ee74f7774a] to [1301722443].
︙ | ︙ | |||
19 20 21 22 23 24 25 | #import "OFKernelEventObserver.h" #ifndef OF_MORPHOS # define OF_FILE_HANDLE_IS_FD # define OF_INVALID_FILE_HANDLE (-1) typedef int of_file_handle_t; #else | < < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #import "OFKernelEventObserver.h" #ifndef OF_MORPHOS # define OF_FILE_HANDLE_IS_FD # define OF_INVALID_FILE_HANDLE (-1) typedef int of_file_handle_t; #else # include <proto/dos.h> # define OF_INVALID_FILE_HANDLE NULL typedef struct of_file_handle *of_file_handle_t; #endif OF_ASSUME_NONNULL_BEGIN @class OFURL; |
︙ | ︙ |
Modified src/OFFile.m from [1cab20f522] to [77e3c3a21e].
︙ | ︙ | |||
45 46 47 48 49 50 51 | #import "OFWriteFailedException.h" #ifdef OF_WINDOWS # include <windows.h> #endif #ifdef OF_WII | < < | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #import "OFWriteFailedException.h" #ifdef OF_WINDOWS # include <windows.h> #endif #ifdef OF_WII # include <fat.h> #endif #ifdef OF_NINTENDO_DS # include <stdbool.h> # include <filesystem.h> #endif |
︙ | ︙ |
Modified src/OFFileManager.m from [74a0735e38] to [96795739ab].
︙ | ︙ | |||
53 54 55 56 57 58 59 | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #ifdef OF_MORPHOS | < < | 53 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_MORPHOS # include <proto/dos.h> # include <proto/locale.h> #endif @interface OFFileManager_default: OFFileManager @end static OFFileManager *defaultManager; |
︙ | ︙ |
Modified src/OFLocalization.m from [8b387494ee] to [ae5afaaea8].
︙ | ︙ | |||
31 32 33 34 35 36 37 | #ifdef OF_AMIGAOS # ifdef OF_AMIGAOS4 # define __NOLIBBASE__ # define __NOGLOBALIFACE__ # define __USE_INLINE__ # endif | < < | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #ifdef OF_AMIGAOS # ifdef OF_AMIGAOS4 # define __NOLIBBASE__ # define __NOGLOBALIFACE__ # define __USE_INLINE__ # endif # include <proto/dos.h> # include <proto/exec.h> # include <proto/locale.h> #endif static OFLocalization *sharedLocalization = nil; #ifdef OF_AMIGAOS4 extern struct ExecIFace *IExec; static struct Library *DOSBase = NULL; |
︙ | ︙ |
Modified src/OFObject.h from [f9418de3f6] to [a6c803a105].
︙ | ︙ | |||
696 697 698 699 700 701 702 | * @brief Try to resolve the specified class method. * * This method is called if a class method was not found, so that an * implementation can be provided at runtime. * * @return Whether the method has been added to the class */ | | | | 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | * @brief Try to resolve the specified class method. * * This method is called if a class method was not found, so that an * implementation can be provided at runtime. * * @return Whether the method has been added to the class */ + (bool)resolveClassMethod: (SEL)selector; /*! * @brief Try to resolve the specified instance method. * * This method is called if an instance method was not found, so that an * implementation can be provided at runtime. * * @return Whether the method has been added to the class */ + (bool)resolveInstanceMethod: (SEL)selector; /*! * @brief Returns the class. * * This method exists so that classes can be used in collections requiring * conformance to the OFCopying protocol. * |
︙ | ︙ |
Modified src/OFObject.m from [4583da4a4e] to [678b6e28e1].
︙ | ︙ | |||
464 465 466 467 468 469 470 | free(methodList); } #endif [self inheritMethodsFromClass: superclass]; } | | | | 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | free(methodList); } #endif [self inheritMethodsFromClass: superclass]; } + (bool)resolveClassMethod: (SEL)selector { return NO; } + (bool)resolveInstanceMethod: (SEL)selector { return NO; } - (instancetype)init { return self; |
︙ | ︙ |
Modified src/OFStdIOStream.h from [acf0fa9e57] to [230fa44006].
︙ | ︙ | |||
15 16 17 18 19 20 21 | * file. */ #import "OFStream.h" #import "OFKernelEventObserver.h" #ifdef OF_MORPHOS | < < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | * file. */ #import "OFStream.h" #import "OFKernelEventObserver.h" #ifdef OF_MORPHOS # include <proto/dos.h> #endif OF_ASSUME_NONNULL_BEGIN /*! * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h * |
︙ | ︙ |
Modified src/OFStdIOStream.m from [66757147ba] to [7f1468fef3].
︙ | ︙ | |||
38 39 40 41 42 43 44 | #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef OF_MORPHOS | < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef OF_MORPHOS # include <proto/exec.h> #endif /* References for static linking */ #ifdef OF_WINDOWS void _reference_to_OFStdIOStream_Win32Console(void) { |
︙ | ︙ |
Modified src/OFSystemInfo.m from [cdbf79507f] to [d70c261d5b].
︙ | ︙ | |||
29 30 31 32 33 34 35 | # include <sys/utsname.h> #endif #ifdef OF_MACOS # include <sys/sysctl.h> #endif #ifdef OF_MORPHOS | < < | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # include <sys/utsname.h> #endif #ifdef OF_MACOS # include <sys/sysctl.h> #endif #ifdef OF_MORPHOS # include <exec/system.h> # include <proto/exec.h> #endif #import "OFSystemInfo.h" #import "OFApplication.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFLocalization.h" |
︙ | ︙ |
Modified src/OFThread.m from [760eefafe7] to [87b40649c1].
︙ | ︙ | |||
29 30 31 32 33 34 35 | # include <sched.h> #endif #include "unistd_wrapper.h" #include "platform.h" #ifdef OF_MORPHOS | < < < < | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # include <sched.h> #endif #include "unistd_wrapper.h" #include "platform.h" #ifdef OF_MORPHOS # include <proto/dos.h> #endif #ifdef OF_WII # define nanosleep ogc_nanosleep # include <ogcsys.h> # undef nanosleep #endif #ifdef OF_NINTENDO_3DS # include <3ds/svc.h> #endif |
︙ | ︙ |
Modified src/OFURLHandler_file.m from [1ed7407f01] to [398809665b].
︙ | ︙ | |||
63 64 65 66 67 68 69 | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #ifdef OF_MORPHOS | < < | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #ifdef OF_MORPHOS # include <proto/dos.h> # include <proto/locale.h> #endif #if defined(OF_WINDOWS) typedef struct __stat64 of_stat_t; #elif defined(OF_MORPHOS) typedef struct { of_offset_t st_size; |
︙ | ︙ |
Modified src/runtime/ObjFW_RT.h from [d5822f4845] to [75ca2f1db8].
︙ | ︙ | |||
51 52 53 54 55 56 57 | #if !__has_feature(objc_arc) && !defined(__unsafe_unretained) # define __unsafe_unretained #endif #define Nil (Class _Null_unspecified)0 #define nil (id _Null_unspecified)0 | | | > | > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #if !__has_feature(objc_arc) && !defined(__unsafe_unretained) # define __unsafe_unretained #endif #define Nil (Class _Null_unspecified)0 #define nil (id _Null_unspecified)0 #define YES true #define NO false typedef struct objc_class *Class; typedef struct objc_object *id; typedef const struct objc_selector *SEL; #if !defined(OF_WII) && !defined(OF_AMIGAOS) typedef bool BOOL; #endif typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...); typedef void (*objc_uncaught_exception_handler)(id _Nullable); typedef void (*objc_enumeration_mutation_handler)(id _Nonnull); struct objc_class { Class _Nonnull isa; Class _Nullable superclass; |
︙ | ︙ | |||
245 246 247 248 249 250 251 | extern void objc_setEnumerationMutationHandler( objc_enumeration_mutation_handler _Nullable); extern void objc_zero_weak_references(id _Nonnull); # ifdef __cplusplus } # endif #else | < < | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | extern void objc_setEnumerationMutationHandler( objc_enumeration_mutation_handler _Nullable); extern void objc_zero_weak_references(id _Nonnull); # ifdef __cplusplus } # endif #else # include <ppcinline/macros.h> # ifdef __cplusplus extern "C" { # endif extern struct Library *ObjFWRTBase; # ifdef __cplusplus } # endif |
︙ | ︙ | |||
284 285 286 287 288 289 290 | extern id _Nullable objc_lookUpClass(const char *_Nonnull); extern id _Nullable objc_getClass(const char *_Nonnull); extern id _Nonnull objc_getRequiredClass(const char *_Nonnull); extern void objc_exception_throw(id _Nullable); extern int objc_sync_enter(id _Nullable); extern int objc_sync_exit(id _Nullable); extern id _Nullable objc_getProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, | | | | | | 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | extern id _Nullable objc_lookUpClass(const char *_Nonnull); extern id _Nullable objc_getClass(const char *_Nonnull); extern id _Nonnull objc_getRequiredClass(const char *_Nonnull); extern void objc_exception_throw(id _Nullable); extern int objc_sync_enter(id _Nullable); extern int objc_sync_exit(id _Nullable); extern id _Nullable objc_getProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, bool); extern void objc_setProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, id _Nullable, bool, signed char); extern void objc_getPropertyStruct(void *_Nonnull, const void *_Nonnull, ptrdiff_t, bool, bool); extern void objc_setPropertyStruct(void *_Nonnull, const void *_Nonnull, ptrdiff_t, bool, bool); extern void objc_enumerationMutation(id _Nonnull); #ifdef __cplusplus } #endif #endif |
Modified src/runtime/class.m from [16946c32d6] to [8659e5eda9].
︙ | ︙ | |||
50 51 52 53 54 55 56 | cls->dtable = empty_dtable; cls->metaclass->dtable = empty_dtable; if (strcmp(cls->name, "Protocol") != 0) classes_cnt++; } | < > | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | cls->dtable = empty_dtable; cls->metaclass->dtable = empty_dtable; if (strcmp(cls->name, "Protocol") != 0) classes_cnt++; } bool class_registerAlias_np(Class cls, const char *name) { if (classes == NULL) return NO; objc_hashtable_set(classes, name, (Class)((uintptr_t)cls | 1)); |
︙ | ︙ |
Modified src/runtime/lookup.m from [d66050c602] to [107b957fe8].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #import "macros.h" @interface DummyObject { Class isa; } | | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #import "macros.h" @interface DummyObject { Class isa; } + (bool)resolveClassMethod: (SEL)selector; + (bool)resolveInstanceMethod: (SEL)selector; @end static IMP forward_handler = (IMP)0; static IMP forward_handler_stret = (IMP)0; static IMP common_method_not_found(id obj, SEL sel, IMP (*lookup)(id, SEL), IMP forward) |
︙ | ︙ |
Modified src/runtime/morphos-library.m from [1e4a1b451d] to [6a9a522909].
︙ | ︙ | |||
16 17 18 19 20 21 22 | */ #include "config.h" #import "ObjFW_RT.h" #import "macros.h" | < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | */ #include "config.h" #import "ObjFW_RT.h" #import "macros.h" #include <dos/dos.h> #include <emul/emulregs.h> #include <exec/execbase.h> #include <exec/nodes.h> #include <exec/resident.h> #include <exec/types.h> #include <proto/exec.h> struct ObjFWRTBase { struct Library library; BPTR seg_list; }; /* Forward declarations for all functions in the func_table */ |
︙ | ︙ |
Modified src/runtime/property.m from [ad22d9f929] to [e9bfb6f639].
︙ | ︙ | |||
37 38 39 40 41 42 43 | for (size_t i = 0; i < NUM_SPINLOCKS; i++) if (!of_spinlock_new(&spinlocks[i])) OBJC_ERROR("Failed to initialize spinlocks!") } #endif id | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | for (size_t i = 0; i < NUM_SPINLOCKS; i++) if (!of_spinlock_new(&spinlocks[i])) OBJC_ERROR("Failed to initialize spinlocks!") } #endif id objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, bool atomic) { if (atomic) { id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); |
︙ | ︙ | |||
59 60 61 62 63 64 65 | #endif } return *(id *)(void *)((char *)self + offset); } void | | | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #endif } return *(id *)(void *)((char *)self + offset); } void objc_setProperty(id self, SEL _cmd, ptrdiff_t offset, id value, bool atomic, signed char copy) { if (atomic) { id *ptr = (id *)(void *)((char *)self + offset); #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(ptr); |
︙ | ︙ | |||
112 113 114 115 116 117 118 | } [old release]; } /* The following methods are only required for GCC >= 4.6 */ void | | | | | | 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 | } [old release]; } /* The following methods are only required for GCC >= 4.6 */ void objc_getPropertyStruct(void *dest, const void *src, ptrdiff_t size, bool atomic, bool strong) { if (atomic) { #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(src); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); #endif memcpy(dest, src, size); #ifdef OF_HAVE_THREADS OF_ENSURE(of_spinlock_unlock(&spinlocks[hash])); #endif return; } memcpy(dest, src, size); } void objc_setPropertyStruct(void *dest, const void *src, ptrdiff_t size, bool atomic, bool strong) { if (atomic) { #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(src); OF_ENSURE(of_spinlock_lock(&spinlocks[hash])); #endif |
︙ | ︙ |
Modified src/runtime/protos.h from [aa2f35848c] to [e94f626094].
︙ | ︙ | |||
27 28 29 30 31 32 33 | IMP objc_msg_lookup_super_stret_inline(struct objc_super *, SEL); id objc_lookUpClass_inline(const char *); id objc_getClass_inline(const char *); id objc_getRequiredClass_inline(const char *); void objc_exception_throw_inline(id); int objc_sync_enter_inline(id); int objc_sync_exit_inline(id); | | | | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | IMP objc_msg_lookup_super_stret_inline(struct objc_super *, SEL); id objc_lookUpClass_inline(const char *); id objc_getClass_inline(const char *); id objc_getRequiredClass_inline(const char *); void objc_exception_throw_inline(id); int objc_sync_enter_inline(id); int objc_sync_exit_inline(id); id objc_getProperty_inline(id, SEL, ptrdiff_t, bool); void objc_setProperty_inline(id, SEL, ptrdiff_t, id, bool, signed char); void objc_getPropertyStruct_inline(void *, const void *, ptrdiff_t, bool, bool); void objc_setPropertyStruct_inline(void *, const void *, ptrdiff_t, bool, bool); void objc_enumerationMutation_inline(id); SEL sel_registerName(const char *); const char *sel_getName(SEL); bool sel_isEqual(SEL, SEL); Class objc_allocateClassPair(Class, const char *, size_t); void objc_registerClassPair(Class); |
︙ | ︙ |
Modified src/socket.h from [e4ca2499ce] to [31842887c2].
︙ | ︙ | |||
22 23 24 25 26 27 28 | #endif #include <stdbool.h> #import "platform.h" #ifdef OF_HAVE_SYS_SOCKET_H | < < < < < < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #endif #include <stdbool.h> #import "platform.h" #ifdef OF_HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef OF_HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef OF_HAVE_NETINET_TCP_H # include <netinet/tcp.h> #endif |
︙ | ︙ | |||
73 74 75 76 77 78 79 | uint8_t ss_len; uint8_t ss_family; char ss_data[2 + sizeof(struct in_addr) + 8]; }; #endif #ifdef OF_WII | < < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | uint8_t ss_len; uint8_t ss_family; char ss_data[2 + sizeof(struct in_addr) + 8]; }; #endif #ifdef OF_WII # include <network.h> struct sockaddr_storage { u8 ss_len; u8 ss_family; u8 ss_data[14]; }; #endif |
︙ | ︙ |
Modified src/unistd_wrapper.h from [05d340e343] to [9807fe4f29].
︙ | ︙ | |||
14 15 16 17 18 19 20 | * file. */ #include "config.h" #include <stdlib.h> /* Make sure we have any libc include */ | < < < < < < < < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | * file. */ #include "config.h" #include <stdlib.h> /* Make sure we have any libc include */ #if defined(HAVE_UNISTD_H) # ifdef __GLIBC__ # undef __USE_XOPEN /* Needed to avoid old glibc using __block */ # endif # include <unistd.h> # ifdef __GLIBC__ # define __USE_XOPEN 1 |
︙ | ︙ |
Modified tests/ForwardingTests.m from [97260d7f73] to [b356b79162].
︙ | ︙ | |||
65 66 67 68 69 70 71 | static void test(id self, SEL _cmd) { success = true; } @implementation ForwardingTest | | | | 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 | static void test(id self, SEL _cmd) { success = true; } @implementation ForwardingTest + (bool)resolveClassMethod: (SEL)selector { forwardings++; if (sel_isEqual(selector, @selector(test))) { class_replaceMethod(object_getClass(self), @selector(test), (IMP)test, "v#:"); return YES; } return NO; } + (bool)resolveInstanceMethod: (SEL)selector { forwardings++; if (sel_isEqual(selector, @selector(test))) { class_replaceMethod(self, @selector(test), (IMP)test, "v@:"); return YES; } |
︙ | ︙ |
Modified tests/TestsAppDelegate.m from [251eb0b81a] to [4afc655dec].
︙ | ︙ | |||
38 39 40 41 42 43 44 | # include <pspkernel.h> # include <pspdebug.h> # include <pspctrl.h> PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0); #endif #ifdef OF_WII | < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | # include <pspkernel.h> # include <pspdebug.h> # include <pspctrl.h> PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0); #endif #ifdef OF_WII # define asm __asm__ # include <gccore.h> # include <wiiuse/wpad.h> # undef asm #endif #ifdef OF_NINTENDO_DS # define asm __asm__ # include <nds.h> # undef asm |
︙ | ︙ |