2010-06-08 16:20:30 +00:00
|
|
|
#include "objc/runtime.h"
|
|
|
|
#include "protocol.h"
|
|
|
|
#include "class.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
@implementation Protocol
|
|
|
|
// FIXME: This needs removing, but it's included for now because GNUstep's
|
|
|
|
// implementation of +[NSObject conformsToProtocol:] calls it.
|
|
|
|
- (BOOL)conformsTo: (Protocol*)p
|
|
|
|
{
|
|
|
|
return protocol_conformsToProtocol(self, p);
|
|
|
|
}
|
2010-10-26 15:44:43 +00:00
|
|
|
- (id)retain
|
|
|
|
{
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
- (void)release {}
|
2011-05-04 17:27:17 +00:00
|
|
|
+ (Class)class { return self; }
|
|
|
|
- (id)self { return self; }
|
2010-06-08 16:20:30 +00:00
|
|
|
@end
|
2011-07-11 11:28:36 +00:00
|
|
|
@implementation Protocol2 @end
|
2010-06-08 16:20:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This class exists for the sole reason that the legacy GNU ABI did not
|
|
|
|
* provide a way of registering protocols with the runtime. With the new ABI,
|
|
|
|
* every protocol in a compilation unit that is not referenced should be added
|
|
|
|
* in a category on this class. This ensures that the runtime sees every
|
|
|
|
* protocol at least once and can perform uniquing.
|
|
|
|
*/
|
|
|
|
@interface __ObjC_Protocol_Holder_Ugly_Hack { id isa; } @end
|
|
|
|
@implementation __ObjC_Protocol_Holder_Ugly_Hack @end
|
|
|
|
|
|
|
|
@implementation Object @end
|