Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -198,10 +198,15 @@ + (void)activateSandbox: (OFSandbox *)sandbox { [app activateSandbox: sandbox]; } #endif + +- init +{ + OF_INVALID_INIT_METHOD +} - OF_init { self = [super init]; Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -24,10 +24,15 @@ #import "OFInitializationFailedException.h" @implementation OFMethod @synthesize selector = _selector, name = _name, typeEncoding = _typeEncoding; + +- init +{ + OF_INVALID_INIT_METHOD +} #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithMethod: (struct objc_method *)method { self = [super init]; @@ -63,15 +68,10 @@ } #else # error Invalid ObjC runtime! #endif -- init -{ - OF_INVALID_INIT_METHOD -} - - (void)dealloc { [_name release]; [super dealloc]; @@ -131,10 +131,15 @@ @end @implementation OFProperty @synthesize name = _name, attributes = _attributes; @synthesize getter = _getter, setter = _setter; + +- init +{ + OF_INVALID_INIT_METHOD +} #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithProperty: (struct objc_property *)property { self = [super init]; @@ -352,10 +357,15 @@ } @end @implementation OFInstanceVariable @synthesize name = _name, offset = _offset, typeEncoding = _typeEncoding; + +- init +{ + OF_INVALID_INIT_METHOD +} #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithIvar: (struct objc_ivar *)ivar { self = [super init]; @@ -390,15 +400,10 @@ } #else # error Invalid ObjC runtime! #endif -- init -{ - OF_INVALID_INIT_METHOD -} - - (void)dealloc { [_name release]; [super dealloc]; @@ -418,10 +423,15 @@ + (instancetype)introspectionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } + +- init +{ + OF_INVALID_INIT_METHOD +} - initWithClass: (Class)class { self = [super init]; @@ -561,19 +571,14 @@ } return self; } -- init -{ - OF_INVALID_INIT_METHOD -} - - (void)dealloc { [_classMethods release]; [_instanceMethods release]; [_instanceVariables release]; [super dealloc]; } @end Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -19,10 +19,15 @@ #import "OFAcceptFailedException.h" #import "OFString.h" @implementation OFAcceptFailedException @synthesize socket = _socket, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSocket: (id)socket errNo: (int)errNo { return [[[self alloc] initWithSocket: socket Index: src/exceptions/OFAllocFailedException.m ================================================================== --- src/exceptions/OFAllocFailedException.m +++ src/exceptions/OFAllocFailedException.m @@ -18,10 +18,15 @@ #import "OFAllocFailedException.h" #import "OFString.h" @implementation OFAllocFailedException ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + + alloc { OF_UNRECOGNIZED_SELECTOR } Index: src/exceptions/OFBindFailedException.m ================================================================== --- src/exceptions/OFBindFailedException.m +++ src/exceptions/OFBindFailedException.m @@ -21,10 +21,15 @@ #import "OFBindFailedException.h" #import "OFString.h" @implementation OFBindFailedException @synthesize host = _host, port = _port, socket = _socket, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo Index: src/exceptions/OFChangeCurrentDirectoryPathFailedException.m ================================================================== --- src/exceptions/OFChangeCurrentDirectoryPathFailedException.m +++ src/exceptions/OFChangeCurrentDirectoryPathFailedException.m @@ -19,10 +19,15 @@ #import "OFChangeCurrentDirectoryPathFailedException.h" #import "OFString.h" @implementation OFChangeCurrentDirectoryPathFailedException @synthesize path = _path, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path Index: src/exceptions/OFChangeOwnerFailedException.m ================================================================== --- src/exceptions/OFChangeOwnerFailedException.m +++ src/exceptions/OFChangeOwnerFailedException.m @@ -19,10 +19,15 @@ #import "OFChangeOwnerFailedException.h" #import "OFString.h" @implementation OFChangeOwnerFailedException @synthesize path = _path, owner = _owner, group = _group, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path owner: (OFString *)owner group: (OFString *)group errNo: (int)errNo Index: src/exceptions/OFChangePermissionsFailedException.m ================================================================== --- src/exceptions/OFChangePermissionsFailedException.m +++ src/exceptions/OFChangePermissionsFailedException.m @@ -19,10 +19,15 @@ #import "OFChangePermissionsFailedException.h" #import "OFString.h" @implementation OFChangePermissionsFailedException @synthesize path = _path, permissions = _permissions, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path permissions: (mode_t)permissions errNo: (int)errNo { Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -21,10 +21,15 @@ #import "OFConnectionFailedException.h" #import "OFString.h" @implementation OFConnectionFailedException @synthesize host = _host, port = _port, socket = _socket, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket { Index: src/exceptions/OFCopyItemFailedException.m ================================================================== --- src/exceptions/OFCopyItemFailedException.m +++ src/exceptions/OFCopyItemFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" @implementation OFCopyItemFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath errNo: (int)errNo { Index: src/exceptions/OFCreateDirectoryFailedException.m ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.m +++ src/exceptions/OFCreateDirectoryFailedException.m @@ -19,10 +19,15 @@ #import "OFCreateDirectoryFailedException.h" #import "OFString.h" @implementation OFCreateDirectoryFailedException @synthesize path = _path, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path Index: src/exceptions/OFCreateSymbolicLinkFailedException.m ================================================================== --- src/exceptions/OFCreateSymbolicLinkFailedException.m +++ src/exceptions/OFCreateSymbolicLinkFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" @implementation OFCreateSymbolicLinkFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath { return [[[self alloc] initWithSourcePath: sourcePath Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -19,10 +19,15 @@ #import "OFEnumerationMutationException.h" #import "OFString.h" @implementation OFEnumerationMutationException @synthesize object = _object; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObject: (id)object { return [[[self alloc] initWithObject: object] autorelease]; } Index: src/exceptions/OFGetOptionFailedException.m ================================================================== --- src/exceptions/OFGetOptionFailedException.m +++ src/exceptions/OFGetOptionFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFStream.h" @implementation OFGetOptionFailedException @synthesize stream = _stream, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo { return [[[self alloc] initWithStream: stream Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -21,10 +21,15 @@ #import "OFHTTPRequest.h" #import "OFHTTPResponse.h" @implementation OFHTTPRequestFailedException @synthesize request = _request, response = _response; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithRequest: (OFHTTPRequest *)request response: (OFHTTPResponse *)response { return [[[self alloc] initWithRequest: request Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -19,10 +19,15 @@ #import "OFHashAlreadyCalculatedException.h" #import "OFString.h" @implementation OFHashAlreadyCalculatedException @synthesize object = _object; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObject: (id)object { return [[[self alloc] initWithObject: object] autorelease]; } Index: src/exceptions/OFInvalidJSONException.m ================================================================== --- src/exceptions/OFInvalidJSONException.m +++ src/exceptions/OFInvalidJSONException.m @@ -19,10 +19,15 @@ #import "OFInvalidJSONException.h" #import "OFString.h" @implementation OFInvalidJSONException @synthesize string = _string, line = _line; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithString: (OFString *)string line: (size_t)line { return [[[self alloc] initWithString: string Index: src/exceptions/OFLinkFailedException.m ================================================================== --- src/exceptions/OFLinkFailedException.m +++ src/exceptions/OFLinkFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" @implementation OFLinkFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath { return [[[self alloc] initWithSourcePath: sourcePath Index: src/exceptions/OFListenFailedException.m ================================================================== --- src/exceptions/OFListenFailedException.m +++ src/exceptions/OFListenFailedException.m @@ -19,10 +19,15 @@ #import "OFListenFailedException.h" #import "OFString.h" @implementation OFListenFailedException @synthesize socket = _socket, backLog = _backLog, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSocket: (id)socket backLog: (int)backLog errNo: (int)errNo { Index: src/exceptions/OFMemoryNotPartOfObjectException.m ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.m +++ src/exceptions/OFMemoryNotPartOfObjectException.m @@ -19,10 +19,15 @@ #import "OFMemoryNotPartOfObjectException.h" #import "OFString.h" @implementation OFMemoryNotPartOfObjectException @synthesize pointer = _pointer, object = _object; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPointer: (void *)pointer object: (id)object { return [[[self alloc] initWithPointer: pointer Index: src/exceptions/OFMoveItemFailedException.m ================================================================== --- src/exceptions/OFMoveItemFailedException.m +++ src/exceptions/OFMoveItemFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" @implementation OFMoveItemFailedException @synthesize sourcePath = _sourcePath, destinationPath = _destinationPath; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSourcePath: (OFString *)sourcePath destinationPath: (OFString *)destinationPath errNo: (int)errNo { Index: src/exceptions/OFNotImplementedException.m ================================================================== --- src/exceptions/OFNotImplementedException.m +++ src/exceptions/OFNotImplementedException.m @@ -19,10 +19,15 @@ #import "OFNotImplementedException.h" #import "OFString.h" @implementation OFNotImplementedException @synthesize selector = _selector, object = _object; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSelector: (SEL)selector object: (id)object { return [[[self alloc] initWithSelector: selector Index: src/exceptions/OFNotOpenException.m ================================================================== --- src/exceptions/OFNotOpenException.m +++ src/exceptions/OFNotOpenException.m @@ -19,10 +19,15 @@ #import "OFNotOpenException.h" #import "OFString.h" @implementation OFNotOpenException @synthesize object = _object; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObject: (id)object { return [[[self alloc] initWithObject: object] autorelease]; } Index: src/exceptions/OFObserveFailedException.m ================================================================== --- src/exceptions/OFObserveFailedException.m +++ src/exceptions/OFObserveFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFKernelEventObserver.h" @implementation OFObserveFailedException @synthesize observer = _observer, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObserver: (OFKernelEventObserver *)observer errNo: (int)errNo { return [[[self alloc] initWithObserver: observer Index: src/exceptions/OFOpenItemFailedException.m ================================================================== --- src/exceptions/OFOpenItemFailedException.m +++ src/exceptions/OFOpenItemFailedException.m @@ -19,10 +19,15 @@ #import "OFOpenItemFailedException.h" #import "OFString.h" @implementation OFOpenItemFailedException @synthesize path = _path, mode = _mode, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } Index: src/exceptions/OFReadOrWriteFailedException.m ================================================================== --- src/exceptions/OFReadOrWriteFailedException.m +++ src/exceptions/OFReadOrWriteFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" @implementation OFReadOrWriteFailedException @synthesize object = _object, requestedLength = _requestedLength; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObject: (id)object requestedLength: (size_t)requestedLength { return [[[self alloc] initWithObject: object Index: src/exceptions/OFRemoveItemFailedException.m ================================================================== --- src/exceptions/OFRemoveItemFailedException.m +++ src/exceptions/OFRemoveItemFailedException.m @@ -19,10 +19,15 @@ #import "OFRemoveItemFailedException.h" #import "OFString.h" @implementation OFRemoveItemFailedException @synthesize path = _path, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path errNo: (int)errNo { return [[[self alloc] initWithPath: path Index: src/exceptions/OFSandboxActivationFailedException.m ================================================================== --- src/exceptions/OFSandboxActivationFailedException.m +++ src/exceptions/OFSandboxActivationFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFSandbox.h" @implementation OFSandboxActivationFailedException @synthesize sandbox = _sandbox, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithSandbox: (OFSandbox *)sandbox errNo: (int)errNo { return [[[self alloc] initWithSandbox: sandbox Index: src/exceptions/OFSeekFailedException.m ================================================================== --- src/exceptions/OFSeekFailedException.m +++ src/exceptions/OFSeekFailedException.m @@ -21,10 +21,15 @@ #import "OFSeekableStream.h" @implementation OFSeekFailedException @synthesize stream = _stream, offset = _offset, whence = _whence; @synthesize errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithStream: (OFSeekableStream *)stream offset: (of_offset_t)offset whence: (int)whence errNo: (int)errNo Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFStream.h" @implementation OFSetOptionFailedException @synthesize stream = _stream, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithStream: (OFStream *)stream errNo: (int)errNo { return [[[self alloc] initWithStream: stream Index: src/exceptions/OFStatItemFailedException.m ================================================================== --- src/exceptions/OFStatItemFailedException.m +++ src/exceptions/OFStatItemFailedException.m @@ -19,10 +19,15 @@ #import "OFStatItemFailedException.h" #import "OFString.h" @implementation OFStatItemFailedException @synthesize path = _path, errNo = _errNo; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPath: (OFString *)path { return [[[self alloc] initWithPath: path] autorelease]; } Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFXMLElement.h" @implementation OFUnboundNamespaceException @synthesize namespace = _namespace, element = _element; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithNamespace: (OFString *)namespace element: (OFXMLElement *)element { return [[[self alloc] initWithNamespace: namespace Index: src/exceptions/OFUnboundPrefixException.m ================================================================== --- src/exceptions/OFUnboundPrefixException.m +++ src/exceptions/OFUnboundPrefixException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFXMLParser.h" @implementation OFUnboundPrefixException @synthesize prefix = _prefix, parser = _parser; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithPrefix: (OFString *)prefix parser: (OFXMLParser *)parser { return [[[self alloc] initWithPrefix: prefix Index: src/exceptions/OFUndefinedKeyException.m ================================================================== --- src/exceptions/OFUndefinedKeyException.m +++ src/exceptions/OFUndefinedKeyException.m @@ -19,10 +19,15 @@ #import "OFUndefinedKeyException.h" #import "OFString.h" @implementation OFUndefinedKeyException @synthesize object = _object, key = _key, value = _value; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithObject: (id)object key: (OFString *)key { return [[[self alloc] initWithObject: object Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -20,10 +20,15 @@ #import "OFString.h" #import "OFURL.h" @implementation OFUnsupportedProtocolException @synthesize URL = _URL; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithURL: (OFURL *)URL { return [[[self alloc] initWithURL: URL] autorelease]; } Index: src/exceptions/OFUnsupportedVersionException.m ================================================================== --- src/exceptions/OFUnsupportedVersionException.m +++ src/exceptions/OFUnsupportedVersionException.m @@ -19,10 +19,15 @@ #import "OFUnsupportedVersionException.h" #import "OFString.h" @implementation OFUnsupportedVersionException @synthesize version = _version; + ++ (instancetype)exception +{ + OF_UNRECOGNIZED_SELECTOR +} + (instancetype)exceptionWithVersion: (OFString *)version { return [[[self alloc] initWithVersion: version] autorelease]; } Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -66,19 +66,17 @@ #ifdef __GNUC__ # define OF_INLINE inline __attribute__((__always_inline__)) # define OF_LIKELY(cond) (__builtin_expect(!!(cond), 1)) # define OF_UNLIKELY(cond) (__builtin_expect(!!(cond), 0)) -# define OF_UNAVAILABLE __attribute__((__unavailable__)) # define OF_CONST_FUNC __attribute__((__const__)) # define OF_NO_RETURN_FUNC __attribute__((__noreturn__)) # define OF_WEAK_REF(sym) __attribute__((__weakref__(sym))) #else # define OF_INLINE inline # define OF_LIKELY(cond) cond # define OF_UNLIKELY(cond) cond -# define OF_UNAVAILABLE # define OF_CONST_FUNC # define OF_NO_RETURN_FUNC # define OF_WEAK_REF(sym) #endif @@ -200,10 +198,16 @@ # define OF_NO_RETURN __attribute__((__noreturn__)) #else # define OF_SENTINEL # define OF_NO_RETURN #endif + +#if __has_attribute(__unavailable__) +# define OF_UNAVAILABLE __attribute__((__unavailable__)) +#else +# define OF_UNAVAILABLE +#endif #if __has_attribute(__objc_requires_super__) # define OF_REQUIRES_SUPER __attribute__((__objc_requires_super__)) #else # define OF_REQUIRES_SUPER