@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2023 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -62,11 +62,13 @@ #ifdef OF_WINDOWS # include #endif #ifdef OF_AMIGAOS +# define Class IntuitionClass # include +# undef Class #endif #ifdef OF_APPLE_RUNTIME extern id _Nullable _objc_rootAutorelease(id _Nullable object); #endif @@ -391,11 +393,10 @@ /* References for static linking */ void _references_to_categories_of_OFObject(void) { _OFObject_KeyValueCoding_reference = 1; - _OFObject_Serialization_reference = 1; } @implementation OFObject + (void)load { @@ -443,15 +444,10 @@ + (instancetype)alloc { return OFAllocObject(self, 0, 0, NULL); } -+ (instancetype)new -{ - return [[self alloc] init]; -} - + (Class)class { return self; } @@ -480,14 +476,12 @@ return class_respondsToSelector(self, selector); } + (bool)conformsToProtocol: (Protocol *)protocol { - Class c; - - for (c = self; c != Nil; c = class_getSuperclass(c)) - if (class_conformsToProtocol(c, protocol)) + for (Class iter = self; iter != Nil; iter = class_getSuperclass(iter)) + if (class_conformsToProtocol(iter, protocol)) return true; return false; } @@ -585,16 +579,16 @@ [self inheritMethodsFromClass: superclass]; } + (bool)resolveClassMethod: (SEL)selector { - return NO; + return false; } + (bool)resolveInstanceMethod: (SEL)selector { - return NO; + return false; } - (instancetype)init { return self;