Mercurial > projects > dstep
comparison dstep/objc/message.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
comparison
equal
deleted
inserted
replaced
24:ab33fc0c3fc1 | 25:b9de51448c6b |
---|---|
23 const int STRUCT_SIZE_LIMIT = 16; | 23 const int STRUCT_SIZE_LIMIT = 16; |
24 | 24 |
25 else version (PPC64) // Not sure about this | 25 else version (PPC64) // Not sure about this |
26 const int STRUCT_SIZE_LIMIT = 16; | 26 const int STRUCT_SIZE_LIMIT = 16; |
27 | 27 |
28 /** | |
29 * Specifies the superclass of an instance. | |
30 * | |
31 * The compiler generates an objc_super data structure when it encounters the super | |
32 * keyword as the receiver of a message. It specifies the class definition of the | |
33 * particular superclass that should be messaged. | |
34 */ | |
28 struct objc_super | 35 struct objc_super |
29 { | 36 { |
37 /** | |
38 * A pointer of type $(DSTEP_EXTERNAL_SYMBOL dstep.objc.objc, id). | |
39 * Specifies an instance of a class. | |
40 */ | |
30 id receiver; | 41 id receiver; |
42 | |
43 /** | |
44 * A pointer to an $(DIL_EXTERNAL_SYMBOL dstep.objc.objc, Class) data | |
45 * structure. Specifies the particular superclass of the instance to message. | |
46 */ | |
31 Class super_class; | 47 Class super_class; |
32 | 48 |
33 // for dwt compatibility | 49 // for dwt compatibility |
34 alias super_class cls; | 50 alias super_class cls; |
35 | 51 |
55 } | 71 } |
56 } | 72 } |
57 | 73 |
58 R objc_msgSend (R = id, ARGS...) (id self, SEL op, ARGS args) | 74 R objc_msgSend (R = id, ARGS...) (id self, SEL op, ARGS args) |
59 { | 75 { |
60 alias extern(C) R function (id, SEL, ARGS) fp; | 76 alias extern (C) R function (id, SEL, ARGS) fp; |
61 return (cast(fp)&bindings.objc_msgSend)(self, op, args); | 77 return (cast(fp)&bindings.objc_msgSend)(self, op, args); |
62 } | 78 } |
63 | 79 |
64 R objc_msgSendSuper (R = id, ARGS...) (objc_super* super_, SEL op, ARGS args) | 80 R objc_msgSendSuper (R = id, ARGS...) (objc_super* super_, SEL op, ARGS args) |
65 { | 81 { |
66 alias extern(C) R function (objc_super*, SEL, ARGS) fp; | 82 alias extern (C) R function (objc_super*, SEL, ARGS) fp; |
67 return (cast(fp)&bindings.objc_msgSendSuper)(super_, op, args); | 83 return (cast(fp)&bindings.objc_msgSendSuper)(super_, op, args); |
68 } | 84 } |
69 | 85 |
70 void objc_msgSend_stret (T, ARGS...) (out T stretAddr, id self, SEL op, ARGS args) | 86 void objc_msgSend_stret (T, ARGS...) (out T stretAddr, id self, SEL op, ARGS args) |
71 { | 87 { |
72 if (T.sizeof > STRUCT_SIZE_LIMIT) | 88 if (T.sizeof > STRUCT_SIZE_LIMIT) |
73 { | 89 { |
74 alias extern(C) void function (T*, id, SEL, ARGS) fp; | 90 alias extern (C) void function (T*, id, SEL, ARGS) fp; |
75 (cast(void function (fp))&bindings.objc_msgSend_stret)(&stretAddr, self, op, args); | 91 (cast(void function (fp))&bindings.objc_msgSend_stret)(&stretAddr, self, op, args); |
76 } | 92 } |
77 | 93 |
78 else | 94 else |
79 { | 95 { |