OSDN Git Service

Remove svn:executable.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc-obj-c++-shared / Object1-implementation.h
1 /* This provides a minimal implementation of the Object root class.
2  * It is split from the definition so that it can be placed
3  * at the end of source files that require it.  This reduces
4  * clutter in .s and other internmediate code while debugging.
5 */
6 #ifndef _OBJC_OBJECT1_IMPLEMENTATION_H_
7 #define _OBJC_OBJECT1_IMPLEMENTATION_H_
8 #ifdef DO_NEXT_M64_OBJECT_IMPLEMENTATION
9 @implementation Object
10
11 + initialize {
12      return self;
13 }
14 - init {
15      return self;
16 }
17
18 + class {
19     return object_getClass(self);
20 }
21
22 + new {
23      return [[self alloc] init];
24 }
25
26 + free {
27      return nil;
28 }
29
30 - free {
31      return object_dispose(self);
32 }
33
34 + alloc {
35      return class_createInstance(self, 0);
36 }
37
38
39 - class {
40      return isa;
41 }
42
43
44 - superclass {
45      return class_getSuperclass([self class]);
46 }
47
48 - (const char *) name {
49      return class_getName([self class]);
50 }
51
52 -(BOOL)conformsTo:(Protocol *)protocol {
53      Class cls;
54      for (cls = [self class]; cls; cls = [cls superclass]) {
55          if (class_conformsToProtocol(cls, protocol)) return YES;
56      }
57      return NO;
58 }
59
60 @end
61 #endif /* NEEDS_OBJECT_IMPLEMENTATION */
62 #endif /* _OBJC_OBJECT1_IMPLEMENTATION_H_ */