git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34005 72102866-910b-0410-8b05-ffd578937521

This commit is contained in:
Richard Frith-MacDonald 2011-10-15 18:36:51 +00:00
parent ec37e7fe81
commit e3588d2fc0
3 changed files with 38 additions and 10 deletions

View file

@ -1,3 +1,9 @@
2011-10-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/ObjectiveC2/NSBlocks.m:
* Source/Additions/GSObjCRuntime.m:
Fixes to build with latest gcc.
2011-10-15 Gregory Casamento <greg.casamento@gmail.com>
* Documentation/GNUmakefile:

View file

@ -136,10 +136,15 @@ GSSelectorFromName(const char *name)
return sel_getUid(name);
}
// FIXME: Hack - need to provide these function declarations
// for gcc 4.6 libobjc. They're called below, and they're declared
// in objc-api.h, but we're using runtime.h, so objc-api.h can't be imported.
#if defined (__GNU_LIBOBJC__)
#if defined (__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ < 20110608)
/* Don't use sel_registerTypedName() ... it's broken when first introduced
* into gcc (fails to correctly check for multiple registrations with same
* types but different layout info).
* Later versions of the runtime should be OK though.
* Hack - need to provide these function declarations
* for gcc 4.6 libobjc. They're called below, and they're declared
* in objc-api.h, but we're using runtime.h, so objc-api.h can't be imported.
*/
SEL sel_get_any_typed_uid(const char *name);
SEL sel_get_typed_uid(const char *name, const char*);
SEL sel_register_name(const char *name);
@ -151,13 +156,8 @@ GSSelectorFromNameAndTypes(const char *name, const char *types)
{
#if NeXT_RUNTIME
return sel_getUid(name);
/* Don't use sel_registerTypedName() ... it's broken when first introduced
* into gcc (fails to correctly check for multple registrations with same
* types but different layout info).
*
#elif defined (__GNU_LIBOBJC__)
#elif defined (__GNU_LIBOBJC__) && (__GNU_LIBOBJC__ >= 20110608)
return sel_registerTypedName(name, types);
*/
#elif defined (__GNUSTEP_RUNTIME__)
return sel_registerTypedName_np(name, types);
#else

View file

@ -1,4 +1,23 @@
#import <objc/objc.h>
#if defined (__GNU_LIBOBJC__)
#warning Unable to build NSBlocks for this runtime.
/* FIXME ... these let us link, but blocks will be broken.
*/
void *_NSConcreteStackBlock;
BOOL objc_create_block_classes_as_subclasses_of(Class super)
{
return NO;
}
#else
#import <objc/objc-api.h>
#import "ObjectiveC2/runtime.h"
#import "ObjectiveC2/blocks_runtime.h"
#include <assert.h>
@ -60,3 +79,6 @@ BOOL objc_create_block_classes_as_subclasses_of(Class super)
NEW_CLASS(&_NSBlock, _NSConcreteGlobalBlock);
return YES;
}
#endif /* defined (__GNU_LIBOBJC__) */