Index: src/OFNull.h ================================================================== --- src/OFNull.h +++ src/OFNull.h @@ -24,10 +24,11 @@ /*! * @class OFNull OFNull.h ObjFW/OFNull.h * * @brief A class for representing null values in collections. */ +OF_SUBCLASSING_RESTRICTED @interface OFNull: OFObject /*! * @brief Returns an OFNull singleton. * Index: src/OFStdIOStream.h ================================================================== --- src/OFStdIOStream.h +++ src/OFStdIOStream.h @@ -24,10 +24,11 @@ * @brief A class for providing standard input, output and error as OFStream. * * The global variables @ref of_stdin, @ref of_stdout and @ref of_stderr are * instances of this class and need no initialization. */ +OF_SUBCLASSING_RESTRICTED @interface OFStdIOStream: OFStream { int _fd; bool _atEndOfStream; } Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -219,10 +219,17 @@ #if __has_attribute(__objc_root_class__) # define OF_ROOT_CLASS __attribute__((__objc_root_class__)) #else # define OF_ROOT_CLASS #endif + +#if __has_attribute(__objc_subclassing_restricted__) +# define OF_SUBCLASSING_RESTRICTED \ + __attribute__((__objc_subclassing_restricted__)) +#else +# define OF_SUBCLASSING_RESTRICTED +#endif #ifdef __GNUC__ # if defined(__x86_64__) || defined(__amd64__) # define OF_X86_64_ASM # elif defined(__i386__)