annotate dstep/objc/message.d @ 27:57371c29ef73 default tip

ObjcWrap is now automatically mixed in. Added support for building as a dylib with DMD.
author Jacob Carlborg <doob@me.com>
date Fri, 09 Apr 2010 23:00:22 +0200
parents b9de51448c6b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Feb 1, 2009
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.objc.message;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
9 import dstep.internal.Version;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
10 import bindings = dstep.objc.bindings;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
11 import dstep.objc.objc;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 import dstep.objc.runtime;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
14 alias void* marg_list;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
15
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
16 version (X86)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
17 const int STRUCT_SIZE_LIMIT = 8;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 else version (PPC)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20 const int STRUCT_SIZE_LIMIT = 4;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
21
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
22 else version (X86_64)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
23 const int STRUCT_SIZE_LIMIT = 16;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
24
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
25 else version (PPC64) // Not sure about this
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
26 const int STRUCT_SIZE_LIMIT = 16;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
27
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
28 /**
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
29 * Specifies the superclass of an instance.
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
30 *
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
31 * The compiler generates an objc_super data structure when it encounters the super
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
32 * keyword as the receiver of a message. It specifies the class definition of the
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
33 * particular superclass that should be messaged.
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
34 */
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
35 struct objc_super
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
36 {
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
37 /**
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
38 * A pointer of type $(DSTEP_EXTERNAL_SYMBOL dstep.objc.objc, id).
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
39 * Specifies an instance of a class.
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
40 */
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
41 id receiver;
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
42
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
43 /**
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
44 * A pointer to an $(DIL_EXTERNAL_SYMBOL dstep.objc.objc, Class) data
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
45 * structure. Specifies the particular superclass of the instance to message.
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
46 */
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 Class super_class;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49 // for dwt compatibility
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50 alias super_class cls;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 R msgSendSuper (R = id, ARGS...) (SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
53 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 6
diff changeset
54 alias extern (C) R function (objc_super*, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
55 return (cast(fp)&bindings.objc_msgSendSuper)(this, op, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58 void msgSendSuper_stret (T, ARGS...) (out T stretAddr, id self, SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
59 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
60 if (T.sizeof > STRUCT_SIZE_LIMIT)
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
61 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 6
diff changeset
62 alias extern (C) void function (T*, objc_super*, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
63 (cast(fp)&bindings.objc_msgSendSuper_stret)(&stretAddr, self, op, args);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
64 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66 else
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
67 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 6
diff changeset
68 alias extern (C) T function (objc_super*, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
69 stretAddr = (*cast(fp)&bindings.objc_msgSendSuper)(self, op, args);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
70 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
72 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
73
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74 R objc_msgSend (R = id, ARGS...) (id self, SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75 {
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
76 alias extern (C) R function (id, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
77 return (cast(fp)&bindings.objc_msgSend)(self, op, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
78 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
79
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80 R objc_msgSendSuper (R = id, ARGS...) (objc_super* super_, SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81 {
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
82 alias extern (C) R function (objc_super*, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
83 return (cast(fp)&bindings.objc_msgSendSuper)(super_, op, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 void objc_msgSend_stret (T, ARGS...) (out T stretAddr, id self, SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
87 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
88 if (T.sizeof > STRUCT_SIZE_LIMIT)
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
89 {
25
b9de51448c6b Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents: 16
diff changeset
90 alias extern (C) void function (T*, id, SEL, ARGS) fp;
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
91 (cast(void function (fp))&bindings.objc_msgSend_stret)(&stretAddr, self, op, args);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
92 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
93
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94 else
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
95 {
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
96 alias extern (C) T function (id, SEL, ARGS) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
97 stretAddr = (*cast(fp)&bindings.objc_msgSend)(self, op, args);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
98 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101 static if (X86 || X86_64)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
102 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103 R objc_msgSend_fpret (R = id, ARGS...) (id self, SEL op, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 version (X86_64)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106 static assert(!is(R : real), "Only real are legal return value for objc_msgSend_fpret");
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108 else
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109 static assert(!is(R : double) && !is(R : float), "Only double and float are legal return values for objc_msgSend_fpret");
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
110
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
111 alias extern (C) R function (id, SEL, ARGS) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
112 return (cast(fp)&bindings.objc_msgSend_fpret)(self, op, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
113 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
114 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
115
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
116 R method_invoke (R = id, ARGS...) (id receiver, Method m, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
117 {
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
118 alias extern (C) R function (id, SEL, ARGS) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
119 return (cast(fp)&bindings.method_invoke)(receiver, m, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
120 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
121
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
122 void method_invoke_stret (ARGS...) (id receiver, Method m, ARGS args)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
123 {
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
124 alias extern (C) R function (id, SEL, ARGS) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
125 return (cast(fp)&bindings.method_invoke_stret)(receiver, m, args);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
126 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
127
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
128 R objc_msgSendv (R = id, T) (id self, SEL op, size_t arg_size, T arg_frame)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
129 {
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
130 alias extern (C) R function (id, SEL, size_t, T) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
131 (cast(fp)&bindings.objc_msgSendv)(self, op, arg_size, arg_frame);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
132 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
133
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
134 void objc_msgSendv_stret (R = id, T) (out T stretAddr, id self, SEL op, size_t arg_size, T arg_frame)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
135 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
136 if (R.sizeof > STRUCT_SIZE_LIMIT)
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
137 {
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
138 alias extern (C) void function (R*, id, SEL, size_t, T) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
139 (cast(fp)&bindings.objc_msgSendv_stret)(&stretAddr, self, op, arg_size, arg_frame);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
140 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
141
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
142 else
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
143 {
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
144 alias extern (C) R function (id, SEL, size_t, T) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
145 stretAddr = (*cast(fp)&bindings.objc_msgSendv)(self, op, arg_size, arg_frame);
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
146 }
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
147 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
148
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
149 version (X86)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
150 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
151 R objc_msgSendv_fpret (R = id, T) (id self, SEL op, uint arg_size, T arg_frame)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
152 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
153 static assert(!is(R : double) && !is(R : float), "Only double and float are legal return values for objc_msgSendv_fpret");
6
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
154 alias extern (C) R function (id, SEL, uint, T) fp;
c0cfd40362ee Fixed the bridge to work with ldc and dmd. Added a couple of hooks to manipulate the source code
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
155 return (cast(fp)&bindings.objc_msgSendv_fpret)(self, op, arg_size, arg_frame);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
156 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
157 }