From 6f349497a5ea35272075a0dea67e3f64b0f3561c Mon Sep 17 00:00:00 2001 From: Stefan Urbanek Date: Sun, 15 Jun 2003 09:35:28 +0000 Subject: [PATCH] Workaround for gnustep-base DO bug git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@16925 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 ++- Source/NSInvocation+additions.m | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f466d6..d54f8bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2003 Jun 15 - * NSInvocation+additions: added unknown selector creation + * NSInvocation+additions: added unknown selector creation; created a + workaround for gnustep DO bug 2003 May 11 Stefan Urbanek diff --git a/Source/NSInvocation+additions.m b/Source/NSInvocation+additions.m index 4d067e8..d53ab9c 100644 --- a/Source/NSInvocation+additions.m +++ b/Source/NSInvocation+additions.m @@ -200,12 +200,14 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject) NSMethodSignature *signature; NSInvocation *invocation; SEL sel; - + BOOL requiresRegistration = NO; + + // NSLog(@"GETTING SELECTOR %@", selectorName); sel = NSSelectorFromString(selectorName); if(!sel) { - NSLog(@"REG REQIRED"); + // NSLog(@"REGISTERING SELECTOR"); char *name = [selectorName cString]; sel = sel_register_name(name); @@ -215,12 +217,23 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject) [NSException raise:STInternalInconsistencyException format:@"Unable to register selector '%@'", selectorName]; - return NULL; + return nil; } + requiresRegistration = YES; } signature = [target methodSignatureForSelector:sel]; + /* FIXME: this is workaround for gnustep DO bug (hight priority) */ + + if(requiresRegistration) + { + // NSLog(@"REGISTERING SELECTOR TYPES"); + sel = sel_register_typed_name([selectorName cString], [signature methodReturnType]); + // NSLog(@"REGISTERED %@", NSStringFromSelector(sel)); + + } + if(!signature) { [NSException raise:STInternalInconsistencyException