mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Make [NSObject -class] return self if self is a class. This is needed for a weird bit of the ObjC spec relating to metaclasses of root classes. The GNUstep runtime behaviour mimics the Apple behaviour, while the GCC runtime mimics the StepStone behaviour, so we get some somewhat irritating differences.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32037 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
068624b659
commit
a8cd2e588c
1 changed files with 4 additions and 1 deletions
|
@ -1119,7 +1119,10 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
*/
|
||||
- (Class) class
|
||||
{
|
||||
return object_getClass(self);
|
||||
id cls = object_getClass(self);
|
||||
if (class_isMetaClass(cls))
|
||||
return (Class)self;
|
||||
return cls;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue