@@ -21,22 +21,20 @@ #import "OFLinkFailedException.h" #import "OFString.h" #import "common.h" -#ifndef _WIN32 +#ifdef OF_HAVE_LINK @implementation OFLinkFailedException -+ (instancetype)exceptionWithClass: (Class)class - sourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath ++ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath + destinationPath: (OFString*)destinationPath { - return [[[self alloc] initWithClass: class - sourcePath: sourcePath - destinationPath: destinationPath] autorelease]; + return [[[self alloc] initWithSourcePath: sourcePath + destinationPath: destinationPath] autorelease]; } -- initWithClass: (Class)class +- init { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @@ -44,15 +42,14 @@ } abort(); } -- initWithClass: (Class)class - sourcePath: (OFString*)sourcePath - destinationPath: (OFString*)destinationPath +- initWithSourcePath: (OFString*)sourcePath + destinationPath: (OFString*)destinationPath { - self = [super initWithClass: class]; + self = [super init]; @try { _sourcePath = [sourcePath copy]; _destinationPath = [destinationPath copy]; _errNo = GET_ERRNO; @@ -73,17 +70,12 @@ } - (OFString*)description { return [OFString stringWithFormat: - @"Failed to link file %@ to %@ in class %@! " ERRFMT, _sourcePath, - _destinationPath, _inClass, ERRPARAM]; -} - -- (int)errNo -{ - return _errNo; + @"Failed to link file %@ to %@! " ERRFMT, _sourcePath, + _destinationPath, ERRPARAM]; } - (OFString*)sourcePath { OF_GETTER(_sourcePath, false) @@ -91,7 +83,12 @@ - (OFString*)destinationPath { OF_GETTER(_destinationPath, false) } + +- (int)errNo +{ + return _errNo; +} @end #endif