annotate dyncall/dyncall_api.c @ 466:ddfb9577a00e

introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed for upcoming aggregate support (until now only x86 platforms allowed for specifically selecting thiscall mode, given the different conventions on the same platform); also added respective DC_SIGCHAR_CC_THISCALL ('*')
author Tassilo Philipp
date Wed, 02 Feb 2022 18:30:44 +0100
parents 2fb084f98439
children 71c884e610f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 Package: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 Library: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 File: dyncall/dyncall_api.c
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description: C interface to call vm
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 License:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>,
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 Tassilo Philipp <tphilipp@potion-studios.com>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 Permission to use, copy, modify, and distribute this software for any
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 purpose with or without fee is hereby granted, provided that the above
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 copyright notice and this permission notice appear in all copies.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 #include "dyncall.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 #include "dyncall_callvm.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 void dcReset(DCCallVM* vm)
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
32 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
33 vm->mVTpointer->reset(vm);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
36 void dcFree(DCCallVM* vm)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
37 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
38 vm->mVTpointer->free(vm);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
41 void dcMode(DCCallVM* vm,DCint mode)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
42 {
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 vm->mVTpointer->mode(vm,mode);
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
46 void dcArgBool(DCCallVM* vm,DCbool x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
47 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
48 vm->mVTpointer->argBool(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 void dcArgChar(DCCallVM* vm,DCchar x)
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
52 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
53 vm->mVTpointer->argChar(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
56 void dcArgShort(DCCallVM* vm,DCshort x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
57 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
58 vm->mVTpointer->argShort(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
61 void dcArgInt(DCCallVM* vm,DCint x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
62 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
63 vm->mVTpointer->argInt(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
66 void dcArgLong(DCCallVM* vm,DClong x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
67 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
68 vm->mVTpointer->argLong(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
71 void dcArgLongLong(DCCallVM* vm, DClonglong x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
72 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
73 vm->mVTpointer->argLongLong(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
76 void dcArgFloat(DCCallVM* vm, DCfloat x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
77 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
78 vm->mVTpointer->argFloat(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
79 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
81 void dcArgDouble(DCCallVM* vm, DCdouble x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
82 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
83 vm->mVTpointer->argDouble(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
86 void dcArgPointer(DCCallVM* vm, DCpointer x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
87 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
88 vm->mVTpointer->argPointer(vm, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
89 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
91 void dcArgStruct(DCCallVM* vm, DCstruct* s, DCpointer x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
92 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
93 vm->mVTpointer->argStruct(vm, s, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
94 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
96
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
97 void dcCallVoid(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
98 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
99 vm->mVTpointer->callVoid(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
101
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
102 DCchar dcCallChar(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
103 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
104 return vm->mVTpointer->callChar(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
105 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
106
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
107 DCbool dcCallBool(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
108 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
109 return vm->mVTpointer->callBool(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
110 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
111
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
112 DCshort dcCallShort(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
113 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
114 return vm->mVTpointer->callShort(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
115 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
116
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
117 DCint dcCallInt(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
118 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
119 return vm->mVTpointer->callInt(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
120 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
121
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
122 DClong dcCallLong(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
123 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
124 return vm->mVTpointer->callLong(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
125 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
126
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
127 DClonglong dcCallLongLong(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
128 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
129 return vm->mVTpointer->callLongLong(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
130 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
131
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
132 DCfloat dcCallFloat(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
133 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
134 return vm->mVTpointer->callFloat(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
135 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
136
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
137 DCdouble dcCallDouble(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
138 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
139 return vm->mVTpointer->callDouble(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
140 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
141
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
142 DCpointer dcCallPointer(DCCallVM* vm, DCpointer funcptr)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
143 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
144 return vm->mVTpointer->callPointer(vm, funcptr);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
145 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
146
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
147 void dcCallStruct(DCCallVM* vm, DCpointer funcptr, DCstruct* s, DCpointer x)
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
148 {
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
149 vm->mVTpointer->callStruct(vm, funcptr, s, x);
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
150 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
151
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
152 DCint dcGetError(DCCallVM *vm)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
153 {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
154 return vm->mError;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
155 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
156
362
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
157 DCint dcGetModeFromCCSigChar(DCsigchar sig_char)
171
011b5e3a8548 - compatibility for older platforms - use ANSI comments
cslag
parents: 84
diff changeset
158 {
362
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
159 switch(sig_char)
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
160 {
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
161 case DC_SIGCHAR_CC_DEFAULT: return DC_CALL_C_DEFAULT;
466
ddfb9577a00e introduced platform-native thiscall mode (DC_CALL_C_DEFAULT_THIS), as needed
Tassilo Philipp
parents: 367
diff changeset
162 case DC_SIGCHAR_CC_THISCALL: return DC_CALL_C_DEFAULT_THIS;
362
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
163 case DC_SIGCHAR_CC_ELLIPSIS: return DC_CALL_C_ELLIPSIS;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
164 case DC_SIGCHAR_CC_ELLIPSIS_VARARGS: return DC_CALL_C_ELLIPSIS_VARARGS;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
165 case DC_SIGCHAR_CC_CDECL: return DC_CALL_C_X86_CDECL;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
166 case DC_SIGCHAR_CC_STDCALL: return DC_CALL_C_X86_WIN32_STD;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
167 case DC_SIGCHAR_CC_FASTCALL_MS: return DC_CALL_C_X86_WIN32_FAST_MS;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
168 case DC_SIGCHAR_CC_FASTCALL_GNU: return DC_CALL_C_X86_WIN32_FAST_GNU;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
169 case DC_SIGCHAR_CC_THISCALL_MS: return DC_CALL_C_X86_WIN32_THIS_MS;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
170 case DC_SIGCHAR_CC_THISCALL_GNU: return DC_CALL_C_X86_WIN32_THIS_GNU;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
171 case DC_SIGCHAR_CC_ARM_ARM: return DC_CALL_C_ARM_ARM;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
172 case DC_SIGCHAR_CC_ARM_THUMB: return DC_CALL_C_ARM_THUMB;
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
173 case DC_SIGCHAR_CC_SYSCALL: return DC_CALL_SYS_DEFAULT;
171
011b5e3a8548 - compatibility for older platforms - use ANSI comments
cslag
parents: 84
diff changeset
174 }
362
78dfa2f9783a - added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents: 281
diff changeset
175 return DC_ERROR_UNSUPPORTED_MODE;
171
011b5e3a8548 - compatibility for older platforms - use ANSI comments
cslag
parents: 84
diff changeset
176 }
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
177