From e2a88e91e3b1f895adbb529ac2776bd450b25cb2 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sat, 26 Sep 1998 05:07:02 +0000 Subject: [PATCH] Tidied method signature stuff git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2984 72102866-910b-0410-8b05-ffd578937521 --- Source/NSDistantObject.m | 25 +++++++++++++++++++++++++ Source/NSProxy.m | 5 +++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Source/NSDistantObject.m b/Source/NSDistantObject.m index c620af3b0..e8eeb8531 100644 --- a/Source/NSDistantObject.m +++ b/Source/NSDistantObject.m @@ -24,6 +24,7 @@ #include #include +#include #include static int debug_proxy; @@ -299,6 +300,30 @@ format: @"NSDistantObject objects only encode with PortEncoder class"]; return self; } +- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector +{ + const char *types = 0; + + if (_protocol) { + struct objc_method_description* mth; + + mth = [_protocol descriptionForInstanceMethod: aSelector]; + if (mth == 0) { + mth = [_protocol descriptionForClassMethod: aSelector]; + } + if (mth != 0) { + types = mth->types; + } + } + else { + types = [self selectorTypeForProxy: aSelector]; + } + if (types == 0) { + return nil; + } + return [NSMethodSignature signatureWithObjCTypes: types]; +} + - (void) setProtocolForProxy: (Protocol*)aProtocol { _protocol = aProtocol; diff --git a/Source/NSProxy.m b/Source/NSProxy.m index b3e4c74f6..abc3aba13 100644 --- a/Source/NSProxy.m +++ b/Source/NSProxy.m @@ -120,7 +120,7 @@ - (void) forwardInvocation: (NSInvocation*)anInvocation { [NSException raise: NSInvalidArgumentException - format: @"NSProxy should does not implement '%s'", + format: @"NSProxy should not implement '%s'", sel_get_name(_cmd)]; } @@ -171,7 +171,8 @@ - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { - [self notImplemented: _cmd]; + [NSException raise: NSInvalidArgumentException format: + @"NSProxy should not implement 'methodSignatureForSelector:'"]; return nil; }