Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -122,20 +122,18 @@ /** * @brief The OFNumber as a string. */ @property (readonly, nonatomic) OFString *stringValue; -#ifdef OF_HAVE_UNAVAILABLE + (instancetype)valueWithBytes: (const void *)bytes objCType: (const char *)objCType OF_UNAVAILABLE; + (instancetype)valueWithPointer: (const void *)pointer OF_UNAVAILABLE; + (instancetype)valueWithNonretainedObject: (id)object OF_UNAVAILABLE; + (instancetype)valueWithRange: (OFRange)range OF_UNAVAILABLE; + (instancetype)valueWithPoint: (OFPoint)point OF_UNAVAILABLE; + (instancetype)valueWithSize: (OFSize)size OF_UNAVAILABLE; + (instancetype)valueWithRect: (OFRect)rect OF_UNAVAILABLE; -#endif /** * @brief Creates a new OFNumber with the specified `bool`. * * @param value The `bool` value which the OFNumber should contain @@ -238,14 +236,12 @@ * @return A new autoreleased OFNumber */ + (instancetype)numberWithDouble: (double)value; - (instancetype)init OF_UNAVAILABLE; -#ifdef OF_HAVE_UNAVAILABLE - (instancetype)initWithBytes: (const void *)bytes objCType: (const char *)objCType OF_UNAVAILABLE; -#endif /** * @brief Initializes an already allocated OFNumber with the specified `bool`. * * @param value The `bool` value which the OFNumber should contain Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -509,10 +509,46 @@ if (self == [OFNumber class]) return (id)&placeholder; return [super alloc]; } + ++ (instancetype)valueWithBytes: (const void *)bytes + objCType: (const char *)objCType +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithPointer: (const void *)pointer +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithNonretainedObject: (id)object +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithRange: (OFRange)range +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithPoint: (OFPoint)point +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithSize: (OFSize)size +{ + OF_UNRECOGNIZED_SELECTOR +} + ++ (instancetype)valueWithRect: (OFRect)rect +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)numberWithBool: (bool)value { return [[[self alloc] initWithBool: value] autorelease]; } @@ -577,10 +613,16 @@ return [[[self alloc] initWithDouble: value] autorelease]; } - (instancetype)init { + OF_INVALID_INIT_METHOD +} + +- (instancetype)initWithBytes: (const void *)bytes + objCType: (const char *)objCType +{ OF_INVALID_INIT_METHOD } - (instancetype)initWithBool: (bool)value { Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -254,11 +254,10 @@ # define OF_WARN_UNUSED_RESULT #endif #if __has_attribute(__unavailable__) # define OF_UNAVAILABLE __attribute__((__unavailable__)) -# define OF_HAVE_UNAVAILABLE #else # define OF_UNAVAILABLE #endif #if __has_attribute(__objc_requires_super__)