Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -51,14 +51,12 @@ # include extern int _CRT_glob; extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *); #elif defined(OF_MORPHOS) -# define BOOL EXEC_BOOL # include # include -# undef BOOL #elif !defined(OF_IOS) extern char **environ; #endif #ifdef OF_PSP Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -21,13 +21,11 @@ #ifndef OF_MORPHOS # define OF_FILE_HANDLE_IS_FD # define OF_INVALID_FILE_HANDLE (-1) typedef int of_file_handle_t; #else -# define BOOL EXEC_BOOL # include -# undef BOOL # define OF_INVALID_FILE_HANDLE NULL typedef struct of_file_handle *of_file_handle_t; #endif OF_ASSUME_NONNULL_BEGIN Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -47,13 +47,11 @@ #ifdef OF_WINDOWS # include #endif #ifdef OF_WII -# define BOOL OGC_BOOL # include -# undef BOOL #endif #ifdef OF_NINTENDO_DS # include # include Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -55,14 +55,12 @@ # include # include #endif #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include # include -# undef BOOL #endif @interface OFFileManager_default: OFFileManager @end Index: src/OFLocalization.m ================================================================== --- src/OFLocalization.m +++ src/OFLocalization.m @@ -33,15 +33,13 @@ # ifdef OF_AMIGAOS4 # define __NOLIBBASE__ # define __NOGLOBALIFACE__ # define __USE_INLINE__ # endif -# define BOOL EXEC_BOOL # include # include # include -# undef BOOL #endif static OFLocalization *sharedLocalization = nil; #ifdef OF_AMIGAOS4 Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -698,21 +698,21 @@ * 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; ++ (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; ++ (bool)resolveInstanceMethod: (SEL)selector; /*! * @brief Returns the class. * * This method exists so that classes can be used in collections requiring Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -466,16 +466,16 @@ #endif [self inheritMethodsFromClass: superclass]; } -+ (BOOL)resolveClassMethod: (SEL)selector ++ (bool)resolveClassMethod: (SEL)selector { return NO; } -+ (BOOL)resolveInstanceMethod: (SEL)selector ++ (bool)resolveInstanceMethod: (SEL)selector { return NO; } - (instancetype)init Index: src/OFStdIOStream.h ================================================================== --- src/OFStdIOStream.h +++ src/OFStdIOStream.h @@ -17,13 +17,11 @@ #import "OFStream.h" #import "OFKernelEventObserver.h" #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include -# undef BOOL #endif OF_ASSUME_NONNULL_BEGIN /*! Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -40,13 +40,11 @@ #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include -# undef BOOL #endif /* References for static linking */ #ifdef OF_WINDOWS void Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -31,14 +31,12 @@ #ifdef OF_MACOS # include #endif #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include # include -# undef BOOL #endif #import "OFSystemInfo.h" #import "OFApplication.h" #import "OFArray.h" Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -31,20 +31,16 @@ #include "unistd_wrapper.h" #include "platform.h" #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include -# undef BOOL #endif #ifdef OF_WII -# define BOOL OGC_BOOL # define nanosleep ogc_nanosleep # include -# undef BOOL # undef nanosleep #endif #ifdef OF_NINTENDO_3DS # include <3ds/svc.h> Index: src/OFURLHandler_file.m ================================================================== --- src/OFURLHandler_file.m +++ src/OFURLHandler_file.m @@ -65,14 +65,12 @@ # include # include #endif #ifdef OF_MORPHOS -# define BOOL EXEC_BOOL # include # include -# undef BOOL #endif #if defined(OF_WINDOWS) typedef struct __stat64 of_stat_t; #elif defined(OF_MORPHOS) Index: src/runtime/ObjFW_RT.h ================================================================== --- src/runtime/ObjFW_RT.h +++ src/runtime/ObjFW_RT.h @@ -53,17 +53,19 @@ # define __unsafe_unretained #endif #define Nil (Class _Null_unspecified)0 #define nil (id _Null_unspecified)0 -#define YES (BOOL)1 -#define NO (BOOL)0 +#define YES true +#define NO false typedef struct objc_class *Class; typedef struct objc_object *id; typedef const struct objc_selector *SEL; -typedef signed char BOOL; +#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 { @@ -247,13 +249,11 @@ extern void objc_zero_weak_references(id _Nonnull); # ifdef __cplusplus } # endif #else -# define BOOL EXEC_BOOL # include -# undef BOOL # ifdef __cplusplus extern "C" { # endif extern struct Library *ObjFWRTBase; # ifdef __cplusplus @@ -286,18 +286,18 @@ 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); + bool); extern void objc_setProperty(id _Nonnull, SEL _Nonnull, ptrdiff_t, id _Nullable, - BOOL, signed char); + bool, signed char); extern void objc_getPropertyStruct(void *_Nonnull, const void *_Nonnull, - ptrdiff_t, BOOL, BOOL); + ptrdiff_t, bool, bool); extern void objc_setPropertyStruct(void *_Nonnull, const void *_Nonnull, - ptrdiff_t, BOOL, BOOL); + ptrdiff_t, bool, bool); extern void objc_enumerationMutation(id _Nonnull); #ifdef __cplusplus } #endif #endif Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -52,11 +52,11 @@ if (strcmp(cls->name, "Protocol") != 0) classes_cnt++; } -BOOL +bool class_registerAlias_np(Class cls, const char *name) { if (classes == NULL) return NO; Index: src/runtime/lookup.m ================================================================== --- src/runtime/lookup.m +++ src/runtime/lookup.m @@ -27,12 +27,12 @@ @interface DummyObject { Class isa; } -+ (BOOL)resolveClassMethod: (SEL)selector; -+ (BOOL)resolveInstanceMethod: (SEL)selector; ++ (bool)resolveClassMethod: (SEL)selector; ++ (bool)resolveInstanceMethod: (SEL)selector; @end static IMP forward_handler = (IMP)0; static IMP forward_handler_stret = (IMP)0; Index: src/runtime/morphos-library.m ================================================================== --- src/runtime/morphos-library.m +++ src/runtime/morphos-library.m @@ -18,19 +18,17 @@ #include "config.h" #import "ObjFW_RT.h" #import "macros.h" -#define BOOL EXEC_BOOL #include #include #include #include #include #include #include -#undef BOOL struct ObjFWRTBase { struct Library library; BPTR seg_list; }; Index: src/runtime/property.m ================================================================== --- src/runtime/property.m +++ src/runtime/property.m @@ -39,11 +39,11 @@ OBJC_ERROR("Failed to initialize spinlocks!") } #endif id -objc_getProperty(id self, SEL _cmd, ptrdiff_t offset, BOOL atomic) +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); @@ -61,11 +61,11 @@ return *(id *)(void *)((char *)self + offset); } void -objc_setProperty(id self, SEL _cmd, ptrdiff_t offset, id value, BOOL atomic, +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 @@ -114,12 +114,12 @@ [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) +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); @@ -135,12 +135,12 @@ memcpy(dest, src, size); } void -objc_setPropertyStruct(void *dest, const void *src, ptrdiff_t size, BOOL atomic, - BOOL strong) +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); Index: src/runtime/protos.h ================================================================== --- src/runtime/protos.h +++ src/runtime/protos.h @@ -29,14 +29,14 @@ 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); +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); Index: src/socket.h ================================================================== --- src/socket.h +++ src/socket.h @@ -24,17 +24,11 @@ #include #import "platform.h" #ifdef OF_HAVE_SYS_SOCKET_H -# ifdef OF_MORPHOS -# define BOOL EXEC_BOOL -# endif # include -# ifdef OF_MORPHOS -# undef BOOL -# endif #endif #ifdef OF_HAVE_NETINET_IN_H # include #endif #ifdef OF_HAVE_NETINET_TCP_H @@ -75,13 +69,11 @@ char ss_data[2 + sizeof(struct in_addr) + 8]; }; #endif #ifdef OF_WII -# define BOOL OGC_BOOL # include -# undef BOOL struct sockaddr_storage { u8 ss_len; u8 ss_family; u8 ss_data[14]; Index: src/unistd_wrapper.h ================================================================== --- src/unistd_wrapper.h +++ src/unistd_wrapper.h @@ -16,18 +16,10 @@ #include "config.h" #include /* Make sure we have any libc include */ -#import "platform.h" - -#ifdef OF_MORPHOS -# define BOOL EXEC_BOOL -# include -# undef BOOL -#endif - #if defined(HAVE_UNISTD_H) # ifdef __GLIBC__ # undef __USE_XOPEN /* Needed to avoid old glibc using __block */ # endif # include Index: tests/ForwardingTests.m ================================================================== --- tests/ForwardingTests.m +++ tests/ForwardingTests.m @@ -67,11 +67,11 @@ { success = true; } @implementation ForwardingTest -+ (BOOL)resolveClassMethod: (SEL)selector ++ (bool)resolveClassMethod: (SEL)selector { forwardings++; if (sel_isEqual(selector, @selector(test))) { class_replaceMethod(object_getClass(self), @selector(test), @@ -80,11 +80,11 @@ } return NO; } -+ (BOOL)resolveInstanceMethod: (SEL)selector ++ (bool)resolveInstanceMethod: (SEL)selector { forwardings++; if (sel_isEqual(selector, @selector(test))) { class_replaceMethod(self, @selector(test), (IMP)test, "v@:"); Index: tests/TestsAppDelegate.m ================================================================== --- tests/TestsAppDelegate.m +++ tests/TestsAppDelegate.m @@ -40,15 +40,13 @@ # include PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0); #endif #ifdef OF_WII -# define BOOL OGC_BOOL # define asm __asm__ # include # include -# undef BOOL # undef asm #endif #ifdef OF_NINTENDO_DS # define asm __asm__