From e8e94cfcfb7cdcd71f3d7d9f591236e5ec4b1bff Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Thu, 15 Jul 2010 09:59:01 +0000 Subject: [PATCH] Fix build with libobjc2. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30967 72102866-910b-0410-8b05-ffd578937521 --- Source/GSFFIInvocation.m | 9 +++++---- Source/NSException.m | 4 ++++ Source/NSThread.m | 2 +- config/config.unexpected.m | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Source/GSFFIInvocation.m b/Source/GSFFIInvocation.m index 9fa5c4571..7199c78f8 100644 --- a/Source/GSFFIInvocation.m +++ b/Source/GSFFIInvocation.m @@ -299,15 +299,16 @@ static id gs_objc_proxy_lookup(id receiver, SEL op) + (void) load { +#ifdef __GNUSTEP_RUNTIME__ + pthread_key_create(&thread_slot_key, free); + objc_msg_forward3 = gs_objc_msg_forward3; + objc_proxy_lookup = gs_objc_proxy_lookup; +#else #if HAVE_FORWARD2 __objc_msg_forward2 = gs_objc_msg_forward2; #else __objc_msg_forward = gs_objc_msg_forward; #endif -#ifdef __GNUSTEP_RUNTIME__ - pthread_key_create(&thread_slot_key, free); - objc_msg_forward3 = gs_objc_msg_forward3; - objc_proxy_lookup = gs_objc_proxy_lookup; #endif } diff --git a/Source/NSException.m b/Source/NSException.m index 5f6010994..673c4d8d7 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -40,6 +40,10 @@ #import "Foundation/NSValue.h" #import "GNUstepBase/NSString+GNUstepBase.h" +#ifdef __GNUSTEP_RUNTIME__ +#include +#endif + #ifdef HAVE_MALLOC_H #include #endif diff --git a/Source/NSThread.m b/Source/NSThread.m index a5ff4ca8d..77ec1d918 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -272,7 +272,7 @@ commonModes(void) return modes; } -#if !defined(HAVE_OBJC_THREAD_ADD) && !defined(NeXT_RUNTIME) +#if !defined(HAVE_OBJC_THREAD_ADD) && !defined(NeXT_RUNTIME) && !defined(__GNUSTEP_RUNTIME__) /* We need to access these private vars in the objc runtime - because the objc runtime's API is not enough powerful for the GNUstep extensions we want to add. */ diff --git a/config/config.unexpected.m b/config/config.unexpected.m index 521ebc03a..5accda91c 100644 --- a/config/config.unexpected.m +++ b/config/config.unexpected.m @@ -1,5 +1,5 @@ -#include "objc-common.g" +extern void (*_objc_unexpected_exception)(id); int main (void) {