@@ -11,13 +11,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#ifndef OBJFW_OF_OBJECT_H -#define OBJFW_OF_OBJECT_H - #include "objfw-defs.h" #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS #endif @@ -30,11 +27,11 @@ #include #include #include "macros.h" -#include "OFOnce.h" +#import "OFOnce.h" /* * Some versions of MinGW require to be included before * . Do this here to make sure this is always done in the correct * order, even if another header includes just . @@ -455,11 +452,10 @@ *hash = tmp; } static const size_t OFNotFound = SIZE_MAX; -#ifdef __OBJC__ @class OFMethodSignature; @class OFString; @class OFThread; /** @@ -678,43 +674,41 @@ * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end -#endif /** * @class OFObject OFObject.h ObjFW/OFObject.h * * @brief The root class for all other classes inside ObjFW. */ -#ifdef __OBJC__ OF_ROOT_CLASS @interface OFObject { @private -# ifndef __clang_analyzer__ +#ifndef __clang_analyzer__ Class _isa; -# else +#else Class _isa __attribute__((__unused__)); -# endif +#endif } -# ifdef OF_HAVE_CLASS_PROPERTIES -# ifndef __cplusplus +#ifdef OF_HAVE_CLASS_PROPERTIES +# ifndef __cplusplus @property (class, readonly, nonatomic) Class class; -# else +# else @property (class, readonly, nonatomic, getter=class) Class class_; -# endif +# endif @property (class, readonly, nonatomic) OFString *className; @property (class, readonly, nullable, nonatomic) Class superclass; @property (class, readonly, nonatomic) OFString *description; -# endif +#endif -# ifndef __cplusplus +#ifndef __cplusplus @property (readonly, nonatomic) Class class; -# else +#else @property (readonly, nonatomic, getter=class) Class class_; #endif @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; @property (readonly, nonatomic) unsigned long hash; @property (readonly, nonatomic) unsigned int retainCount; @@ -1056,11 +1050,11 @@ withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; -# ifdef OF_HAVE_THREADS +#ifdef OF_HAVE_THREADS /** * @brief Performs the specified selector on the specified thread. * * @param selector The selector to perform * @param thread The thread on which to perform the selector @@ -1314,11 +1308,11 @@ withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; -# endif +#endif /** * @brief This method is called when @ref resolveClassMethod: or * @ref resolveInstanceMethod: returned false. It should return a target * to which the message should be forwarded. @@ -1340,15 +1334,11 @@ * @param selector The selector not understood by the receiver * @throw OFNotImplementedException */ - (void)doesNotRecognizeSelector: (SEL)selector OF_NO_RETURN; @end -#else -typedef void OFObject; -#endif -#ifdef __OBJC__ /** * @protocol OFCopying OFObject.h ObjFW/OFObject.h * * @brief A protocol for the creation of copies. */ @@ -1396,11 +1386,10 @@ * @param object An object to compare the object to * @return The result of the comparison */ - (OFComparisonResult)compare: (id )object; @end -#endif #ifdef __cplusplus extern "C" { #endif /** @@ -1510,12 +1499,7 @@ } #endif OF_ASSUME_NONNULL_END -#include "OFBlock.h" - -#ifdef __OBJC__ -# import "OFObject+KeyValueCoding.h" -#endif - -#endif +#import "OFBlock.h" +#import "OFObject+KeyValueCoding.h"