Mercurial > pub > dyncall > dyncall
annotate dyncall/dyncall_callf.c @ 542:a73a5cd50c19
- fix passing aggregate-by-val on x64/sysv: subaggr classification for
aggr *arrays* was wrong (was problematic when there ware exactly 2 8bytes to
be classified, potentially be passed via registers)
author | Tassilo Philipp |
---|---|
date | Mon, 02 May 2022 15:32:41 +0200 |
parents | 71c884e610f0 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncall | |
5 File: dyncall/dyncall_callf.c | |
6 Description: formatted call C interface (extension module) | |
7 License: | |
8 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | |
12 Permission to use, copy, modify, and distribute this software for any | |
13 purpose with or without fee is hereby granted, provided that the above | |
14 copyright notice and this permission notice appear in all copies. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
23 | |
24 */ | |
25 | |
26 | |
27 | |
28 #include "dyncall_callf.h" | |
29 | |
30 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
31 static void handle_mode(DCCallVM* vm, const DCsigchar** sigptr) |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
32 { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
33 if(*((*sigptr)+1) != '\0') { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
34 DCint mode = dcGetModeFromCCSigChar(*(*sigptr)++); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
35 if(mode != DC_ERROR_UNSUPPORTED_MODE) |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
36 dcMode(vm, mode); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
37 } |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
38 } |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
39 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
40 |
171
011b5e3a8548
- compatibility for older platforms - use ANSI comments
cslag
parents:
74
diff
changeset
|
41 /* Shareable implementation for argument binding used in ArgF and CallF below. */ |
0 | 42 static void dcArgF_impl(DCCallVM* vm, const DCsigchar** sigptr, va_list args) |
43 { | |
44 DCsigchar ch; | |
45 while((ch=*(*sigptr)++) != '\0' && ch != DC_SIGCHAR_ENDARG) { | |
46 switch(ch) { | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
47 /* calling convention modes */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
48 case DC_SIGCHAR_CC_PREFIX: handle_mode(vm, sigptr); break; |
358
30aae7371373
- extended signature with calling convention mode switches for fastcall (gnu), default, cdecl, stdcall, arm (arm), arm (thumb), syscall
Tassilo Philipp
parents:
281
diff
changeset
|
49 /* types */ |
0 | 50 case DC_SIGCHAR_BOOL: dcArgBool (vm, (DCbool) va_arg(args, DCint )); break; |
51 case DC_SIGCHAR_CHAR: dcArgChar (vm, (DCchar) va_arg(args, DCint )); break; | |
52 case DC_SIGCHAR_UCHAR: dcArgChar (vm, (DCchar)(DCuchar) va_arg(args, DCint )); break; | |
53 case DC_SIGCHAR_SHORT: dcArgShort (vm, (DCshort) va_arg(args, DCint )); break; | |
54 case DC_SIGCHAR_USHORT: dcArgShort (vm, (DCshort)(DCushort)va_arg(args, DCint )); break; | |
55 case DC_SIGCHAR_INT: dcArgInt (vm, (DCint) va_arg(args, DCint )); break; | |
56 case DC_SIGCHAR_UINT: dcArgInt (vm, (DCint)(DCuint) va_arg(args, DCint )); break; | |
57 case DC_SIGCHAR_LONG: dcArgLong (vm, (DClong) va_arg(args, DClong )); break; | |
58 case DC_SIGCHAR_ULONG: dcArgLong (vm, (DCulong) va_arg(args, DClong )); break; | |
59 case DC_SIGCHAR_LONGLONG: dcArgLongLong(vm, (DClonglong) va_arg(args, DClonglong)); break; | |
60 case DC_SIGCHAR_ULONGLONG: dcArgLongLong(vm, (DCulonglong) va_arg(args, DClonglong)); break; | |
61 case DC_SIGCHAR_FLOAT: dcArgFloat (vm, (DCfloat) va_arg(args, DCdouble )); break; | |
62 case DC_SIGCHAR_DOUBLE: dcArgDouble (vm, (DCdouble) va_arg(args, DCdouble )); break; | |
63 case DC_SIGCHAR_POINTER: dcArgPointer (vm, (DCpointer) va_arg(args, DCpointer )); break; | |
64 case DC_SIGCHAR_STRING: dcArgPointer (vm, (DCpointer) va_arg(args, DCpointer )); break; | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
65 case DC_SIGCHAR_AGGREGATE: { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
66 /* aggregates expect 2 va args, a DCaggr*, then a ptr to the aggregate */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
67 DCaggr* ag = va_arg(args, DCaggr*); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
68 dcArgAggr(vm, ag, va_arg(args, DCpointer)); |
362
78dfa2f9783a
- added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
Tassilo Philipp
parents:
359
diff
changeset
|
69 break; |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
70 } |
0 | 71 } |
72 } | |
73 } | |
74 | |
75 void dcVArgF(DCCallVM* vm, const DCsigchar* signature, va_list args) | |
76 { | |
77 dcArgF_impl(vm, &signature, args); | |
78 } | |
79 | |
80 void dcArgF(DCCallVM* vm, const DCsigchar* signature, ...) | |
81 { | |
82 va_list va; | |
83 va_start(va, signature); | |
84 dcVArgF(vm,signature,va); | |
85 va_end(va); | |
86 } | |
87 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
88 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
89 /* msvc introduced C99'w va_copy() late (in 2013 w/ msvc 18.00); plan9 APE does |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
90 * not have it either; luckily given their va_list being only a ptr in both |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
91 * cases, work around the issue for older versions */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
92 #if (defined(DC__C_MSVC) || defined(DC__OS_Plan9)) && !defined(va_copy) |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
93 #define va_copy(dst, src) ((dst)=(src)) |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
94 #endif |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
95 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
96 |
0 | 97 void dcVCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, va_list args) |
98 { | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
99 DCaggr* ret_ag = NULL; /* only needed for when func returns an aggregate */ |
0 | 100 const DCsigchar* ptr = signature; |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
101 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
102 /* need preparatory call if return type is an aggregate, so check end of sig */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
103 /* @@@ugly */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
104 while(*ptr && ptr[1]) ++ptr; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
105 if(*ptr == DC_SIGCHAR_AGGREGATE) { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
106 va_list args_; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
107 va_copy(args_, args); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
108 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
109 /* iterate va_list to get return type related args*/ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
110 ptr = signature; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
111 while(*ptr) { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
112 switch(*ptr++) { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
113 /* calling convention modes */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
114 case DC_SIGCHAR_CC_PREFIX: handle_mode(vm, &ptr); break; /* needs handling before dcBeginCallAggr */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
115 /* types */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
116 case DC_SIGCHAR_BOOL: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
117 case DC_SIGCHAR_CHAR: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
118 case DC_SIGCHAR_UCHAR: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
119 case DC_SIGCHAR_SHORT: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
120 case DC_SIGCHAR_USHORT: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
121 case DC_SIGCHAR_INT: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
122 case DC_SIGCHAR_UINT: va_arg(args_, DCint ); break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
123 case DC_SIGCHAR_LONG: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
124 case DC_SIGCHAR_ULONG: va_arg(args_, DClong ); break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
125 case DC_SIGCHAR_LONGLONG: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
126 case DC_SIGCHAR_ULONGLONG: va_arg(args_, DClonglong); break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
127 case DC_SIGCHAR_FLOAT: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
128 case DC_SIGCHAR_DOUBLE: va_arg(args_, DCdouble ); break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
129 case DC_SIGCHAR_POINTER: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
130 case DC_SIGCHAR_STRING: va_arg(args_, DCpointer ); break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
131 case DC_SIGCHAR_AGGREGATE: |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
132 /* aggregate as retval expects 2 more va args, a DCaggr*, then a ptr to the aggregate */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
133 ret_ag = va_arg(args_, DCaggr*); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
134 result->p = va_arg(args_, DCpointer); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
135 break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
136 } |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
137 } |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
138 dcBeginCallAggr(vm, ret_ag); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
139 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
140 va_end(args_); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
141 } |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
142 |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
143 /* push args */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
144 ptr = signature; |
0 | 145 dcArgF_impl(vm, &ptr, args); |
146 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
147 /* call */ |
0 | 148 switch(*ptr) { |
74
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
149 case DC_SIGCHAR_VOID: dcCallVoid (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
150 case DC_SIGCHAR_BOOL: result->B = dcCallBool (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
151 case DC_SIGCHAR_CHAR: result->c = dcCallChar (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
152 case DC_SIGCHAR_UCHAR: result->C = (DCuchar)dcCallChar (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
153 case DC_SIGCHAR_SHORT: result->s = dcCallShort (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
154 case DC_SIGCHAR_USHORT: result->S = dcCallShort (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
155 case DC_SIGCHAR_INT: result->i = dcCallInt (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
156 case DC_SIGCHAR_UINT: result->I = dcCallInt (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
157 case DC_SIGCHAR_LONG: result->j = dcCallLong (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
158 case DC_SIGCHAR_ULONG: result->J = dcCallLong (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
159 case DC_SIGCHAR_LONGLONG: result->l = dcCallLongLong (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
160 case DC_SIGCHAR_ULONGLONG: result->L = dcCallLongLong (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
161 case DC_SIGCHAR_FLOAT: result->f = dcCallFloat (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
162 case DC_SIGCHAR_DOUBLE: result->d = dcCallDouble (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
163 case DC_SIGCHAR_POINTER: result->p = dcCallPointer (vm,funcptr); break; |
f2a8dfd795e8
- pointer cast for callf to make C++ compilers happy that don't do void* implicit casts (also, as DC_POINTER might be set to something other than void*, this cast would be needed)
cslag
parents:
0
diff
changeset
|
164 case DC_SIGCHAR_STRING: result->Z = (DCstring)dcCallPointer(vm,funcptr); break; |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
165 case DC_SIGCHAR_AGGREGATE: { |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
166 result->p = dcCallAggr(vm, funcptr, ret_ag, result->p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
167 break; |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
362
diff
changeset
|
168 } |
0 | 169 } |
170 } | |
171 | |
172 void dcCallF(DCCallVM* vm, DCValue* result, DCpointer funcptr, const DCsigchar* signature, ...) | |
173 { | |
174 va_list va; | |
175 va_start(va, signature); | |
176 dcVCallF(vm,result,funcptr,signature,va); | |
177 va_end(va); | |
178 } | |
179 |