author | Claus Gittinger <cg@exept.de> |
Tue, 23 Aug 2016 12:12:18 +0200 | |
changeset 20297 | 85746bbcaf03 |
parent 20295 | 87dc882749b0 |
child 20299 | 7db2dc640f2f |
permissions | -rw-r--r-- |
8728 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
9464 | 3 |
All Rights Reserved |
8728 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
8533 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
19311 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
8533 | 16 |
ExternalFunction subclass:#ExternalLibraryFunction |
9465 | 17 |
instanceVariableNames:'flags moduleName returnType argumentTypes owningClass' |
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
18 |
classVariableNames:'DLLPATH FLAG_VIRTUAL FLAG_NONVIRTUAL FLAG_OBJECTIVEC FLAG_ASYNC |
10270 | 19 |
FLAG_UNLIMITEDSTACK FLAG_RETVAL_IS_CONST CALLTYPE_MASK |
20 |
CALLTYPE_API CALLTYPE_C CALLTYPE_OLE CALLTYPE_V8 CALLTYPE_V9 |
|
19342 | 21 |
CALLTYPE_UNIX64 DllMapping Verbose LastModuleHandleHolder |
22 |
LastModuleHandleName' |
|
9464 | 23 |
poolDictionaries:'' |
24 |
category:'System-Support' |
|
8533 | 25 |
! |
26 |
||
9322 | 27 |
!ExternalLibraryFunction primitiveDefinitions! |
28 |
%{ |
|
20297
85746bbcaf03
compiler warning eliminated
Claus Gittinger <cg@exept.de>
parents:
20295
diff
changeset
|
29 |
#include "stxOSDefs.h" |
85746bbcaf03
compiler warning eliminated
Claus Gittinger <cg@exept.de>
parents:
20295
diff
changeset
|
30 |
|
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
31 |
#define VERBOSE |
9322 | 32 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
33 |
#ifdef VERBOSE |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
34 |
# define DEBUGCODE_IF(flag, code) if ((flag) == true) { code } |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
35 |
# else |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
36 |
# define DEBUG_IF(flag, code) /* nothing */ |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
37 |
# endif |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
38 |
|
9337 | 39 |
#ifdef HAVE_FFI |
20288
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
40 |
|
9337 | 41 |
# include <ffi.h> |
9322 | 42 |
# define MAX_ARGS 128 |
9365 | 43 |
|
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
44 |
# ifdef USE_STANDARD_FFI |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
45 |
# define __get_ffi_type_sint() &ffi_type_sint |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
46 |
# define __get_ffi_type_sint8() &ffi_type_sint8 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
47 |
# define __get_ffi_type_sint16() &ffi_type_sint16 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
48 |
# define __get_ffi_type_sint32() &ffi_type_sint32 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
49 |
# define __get_ffi_type_sint64() &ffi_type_sint64 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
50 |
# define __get_ffi_type_uint() &ffi_type_uint |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
51 |
# define __get_ffi_type_uint8() &ffi_type_uint8 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
52 |
# define __get_ffi_type_uint16() &ffi_type_uint16 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
53 |
# define __get_ffi_type_uint32() &ffi_type_uint32 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
54 |
# define __get_ffi_type_uint64() &ffi_type_uint64 |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
55 |
# define __get_ffi_type_float() &ffi_type_float |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
56 |
# define __get_ffi_type_double() &ffi_type_double |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
57 |
# define __get_ffi_type_void() &ffi_type_void |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
58 |
# define __get_ffi_type_pointer() &ffi_type_pointer |
19931 | 59 |
|
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
60 |
# else |
19931 | 61 |
|
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
62 |
extern ffi_type *__get_ffi_type_sint(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
63 |
extern ffi_type *__get_ffi_type_sint8(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
64 |
extern ffi_type *__get_ffi_type_sint16(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
65 |
extern ffi_type *__get_ffi_type_sint32(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
66 |
extern ffi_type *__get_ffi_type_sint64(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
67 |
extern ffi_type *__get_ffi_type_uint(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
68 |
extern ffi_type *__get_ffi_type_uint8(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
69 |
extern ffi_type *__get_ffi_type_uint16(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
70 |
extern ffi_type *__get_ffi_type_uint32(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
71 |
extern ffi_type *__get_ffi_type_uint64(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
72 |
extern ffi_type *__get_ffi_type_float(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
73 |
extern ffi_type *__get_ffi_type_double(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
74 |
extern ffi_type *__get_ffi_type_void(); |
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
75 |
extern ffi_type *__get_ffi_type_pointer(); |
19535 | 76 |
extern INTFUNC __get_ffi_prep_cif(); |
77 |
extern INTFUNC __get_ffi_call(); |
|
19536 | 78 |
# ifdef _MINGW__ |
79 |
# define ffi_prep_cif (*(__get_ffi_prep_cif())) |
|
80 |
# define ffi_call (*(__get_ffi_call())) |
|
81 |
# endif |
|
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
82 |
# endif |
9365 | 83 |
|
19931 | 84 |
# define TYPE_UINT __get_ffi_type_uint() |
85 |
# define TYPE_UINT8 __get_ffi_type_uint8() |
|
86 |
# define TYPE_UINT16 __get_ffi_type_uint16() |
|
87 |
# define TYPE_UINT32 __get_ffi_type_uint32() |
|
88 |
# define TYPE_UINT64 __get_ffi_type_uint64() |
|
89 |
||
90 |
# define TYPE_SINT __get_ffi_type_sint() |
|
91 |
# define TYPE_SINT8 __get_ffi_type_sint8() |
|
92 |
# define TYPE_SINT16 __get_ffi_type_sint16() |
|
93 |
# define TYPE_SINT32 __get_ffi_type_sint32() |
|
94 |
# define TYPE_SINT64 __get_ffi_type_sint64() |
|
95 |
||
96 |
# define TYPE_POINTER __get_ffi_type_pointer() |
|
19950 | 97 |
# define TYPE_FLOAT __get_ffi_type_float() |
98 |
# define TYPE_DOUBLE __get_ffi_type_double() |
|
99 |
# define TYPE_VOID __get_ffi_type_void() |
|
19931 | 100 |
|
101 |
#else /* NO FFI */ |
|
102 |
||
103 |
# define MAX_ARGS 15 |
|
104 |
# define TYPE_UINT 1 |
|
105 |
# define TYPE_UINT8 2 |
|
106 |
# define TYPE_UINT16 3 |
|
107 |
# define TYPE_UINT32 4 |
|
108 |
# define TYPE_UINT64 5 |
|
109 |
||
110 |
# define TYPE_SINT 11 |
|
111 |
# define TYPE_SINT8 12 |
|
112 |
# define TYPE_SINT16 13 |
|
113 |
# define TYPE_SINT32 14 |
|
114 |
# define TYPE_SINT64 15 |
|
115 |
||
116 |
# define TYPE_POINTER 20 |
|
117 |
# define TYPE_FLOAT 30 |
|
118 |
# define TYPE_DOUBLE 31 |
|
119 |
# define TYPE_VOID 40 |
|
120 |
||
121 |
# define FFI_DEFAULT_ABI 0 |
|
122 |
# define CALLTYPE_FFI_STDCALL 0 |
|
123 |
||
9337 | 124 |
#endif |
9322 | 125 |
|
126 |
%} |
|
127 |
! ! |
|
128 |
||
8728 | 129 |
!ExternalLibraryFunction class methodsFor:'documentation'! |
130 |
||
131 |
copyright |
|
132 |
" |
|
133 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
9464 | 134 |
All Rights Reserved |
8728 | 135 |
|
136 |
This software is furnished under a license and may be used |
|
137 |
only in accordance with the terms of that license and with the |
|
138 |
inclusion of the above copyright notice. This software may not |
|
139 |
be provided or otherwise made available to, or used by, any |
|
140 |
other person. No title to or ownership of the software is |
|
141 |
hereby transferred. |
|
142 |
" |
|
9322 | 143 |
! |
144 |
||
9331 | 145 |
documentation |
146 |
" |
|
147 |
instances of me are used to interface to external library functions (as found in a dll/shared object). |
|
19933 | 148 |
Foreign function calls are based on the FFI library if available. |
149 |
A limited fallback implementation is provided for systems with no libffi. |
|
150 |
(this may have limitations on the supported argument types; for example, |
|
151 |
the x86_64 fallback does not support float/double arguments). |
|
19950 | 152 |
Therefore the fallback should be considered a temporary workaround, |
19933 | 153 |
until libffi has been ported. |
19950 | 154 |
|
12680 | 155 |
Inside a method, when a special external-call pragma such as: |
19950 | 156 |
<api: bool MessageBeep(uint)> |
12680 | 157 |
|
158 |
is encountered by the parser, the compiler generates a call via |
|
19950 | 159 |
<correspondingExternalLibraryFunctionObject> invokeWithArguments: argumentArray. |
19549 | 160 |
and the correspondingExternalLibraryFunctionObject is kept in the literal array. |
9331 | 161 |
|
162 |
In the invoke method, the library is checked to be loaded (and loaded if not already), |
|
9336 | 163 |
the arguments are converted to C and pushed onto the C-stack, the function is called, |
9331 | 164 |
and finally, the return value is converted back from C to a smalltalk object. |
12680 | 165 |
|
166 |
The parser supports the call-syntax of various other smalltalk dialects: |
|
19950 | 167 |
Squeak / ST-X: |
168 |
<cdecl: [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName > |
|
169 |
<apicall: [async] [virtual|nonVirtual][const] returnType functionNameStringOrIndex ( argType1..argTypeN ) module: moduleName > |
|
12680 | 170 |
|
19950 | 171 |
Dolphin: |
172 |
<stdcall: [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN> |
|
173 |
<cdecl: [virtual|nonVirtual][const] returnType functionNameStringOrIndex argType1..argTypeN> |
|
12680 | 174 |
|
19950 | 175 |
ST/V: |
176 |
<api: functionName argType1 .. argTypeN returnType> |
|
177 |
<ccall: functionName argType1 .. argTypeN returnType> |
|
178 |
<ole: vFunctionIndex argType1 .. argTypeN returnType> |
|
12680 | 179 |
|
19950 | 180 |
VisualWorks: |
181 |
<c: ...> |
|
182 |
<c: #define NAME value> |
|
9331 | 183 |
" |
184 |
! |
|
185 |
||
9322 | 186 |
example |
187 |
" |
|
14625 | 188 |
[exBegin] |
189 |
|f| |
|
14037 | 190 |
|
14625 | 191 |
f := ExternalLibraryFunction new. |
192 |
f beCallTypeWINAPI. |
|
14037 | 193 |
|
14625 | 194 |
f name:'MessageBeep' |
195 |
module:'user32.dll' |
|
196 |
returnType:#boolean |
|
197 |
argumentTypes:#(uint). |
|
14037 | 198 |
|
14625 | 199 |
f invokeWith:1. |
200 |
[exEnd] |
|
14037 | 201 |
|
202 |
Synchronous vs. Asynchronous calls: |
|
203 |
||
14516
359e4d2234af
class: ExternalLibraryFunction
Stefan Vogel <sv@exept.de>
parents:
14506
diff
changeset
|
204 |
by default, foreign function calls are synchronous, effectively blocking the whole ST/X system |
19514 | 205 |
(that is by purpose,´because most C-code is not prepared for being interrupted, and also, normal |
14037 | 206 |
code is not prepared for a garbage collector to move objects around, while another C thread might |
207 |
access the data...). |
|
14625 | 208 |
Therefore, the following will block all ST/X activity for 10 seconds |
14037 | 209 |
(try interacting with the launcher while the Sleep is performing): |
210 |
||
14625 | 211 |
[exBegin] |
212 |
|f| |
|
9322 | 213 |
|
14625 | 214 |
f := ExternalLibraryFunction new. |
215 |
f beCallTypeWINAPI. |
|
14037 | 216 |
|
14625 | 217 |
f name:'Sleep' |
218 |
module:'kernel32.dll' |
|
219 |
returnType:#void |
|
220 |
argumentTypes:#(uint). |
|
14037 | 221 |
|
14625 | 222 |
f invokeWith:10000. |
223 |
[exEnd] |
|
9322 | 224 |
|
14037 | 225 |
if you know what you do and you do not pass any possibly moving objects (such as strings) as argument, |
226 |
the call can be made asynchronous. In that case, ONLY the calling thread will be blocked; all other smalltalk |
|
227 |
threads wil continue to execute. |
|
228 |
(try interacting now with the launcher while the Sleep is performing): |
|
14625 | 229 |
[exBegin] |
230 |
|f| |
|
14037 | 231 |
|
14625 | 232 |
f := ExternalLibraryFunction new. |
233 |
f beCallTypeWINAPI. |
|
234 |
f beAsync. |
|
14037 | 235 |
|
14625 | 236 |
f name:'Sleep' |
237 |
module:'kernel32.dll' |
|
238 |
returnType:#void |
|
239 |
argumentTypes:#(uint). |
|
14037 | 240 |
|
14625 | 241 |
f invokeWith:10000. |
242 |
[exEnd] |
|
14037 | 243 |
|
9322 | 244 |
" |
8728 | 245 |
! ! |
8533 | 246 |
|
8550 | 247 |
!ExternalLibraryFunction class methodsFor:'instance creation'! |
248 |
||
9465 | 249 |
name:functionName module:moduleName returnType:returnType argumentTypes:argTypes |
8550 | 250 |
^ self new |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
251 |
name:functionName module:moduleName |
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
252 |
returnType:returnType argumentTypes:argTypes |
9465 | 253 |
|
254 |
"Created: / 01-08-2006 / 15:19:08 / cg" |
|
9463 | 255 |
! ! |
256 |
||
257 |
!ExternalLibraryFunction class methodsFor:'class initialization'! |
|
258 |
||
11050 | 259 |
addToDllPath:aDirectoryPathName |
260 |
"can be used during initialization, to add more places for dll-loading" |
|
261 |
||
19487 | 262 |
|oldPath newPath| |
11053 | 263 |
|
264 |
oldPath := self dllPath. |
|
265 |
(oldPath includes:aDirectoryPathName) ifFalse:[ |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
266 |
newPath := oldPath asOrderedCollection. |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
267 |
newPath add:aDirectoryPathName. |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
268 |
self dllPath:newPath |
11053 | 269 |
] |
20289 | 270 |
|
271 |
" |
|
272 |
self addToDllPath:'c:\matrix\API\dll' |
|
273 |
" |
|
11050 | 274 |
! |
275 |
||
14103 | 276 |
dllMapping |
277 |
"allows for dll's to be replaced, |
|
278 |
for example, if you want to use the mozilla sqlite dll |
|
19860
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
279 |
C:\Program Files\Mozilla Firefox\mozsqlite3.dll |
14103 | 280 |
for the sqlite3, execute: |
19860
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
281 |
ExternalLibraryFunction |
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
282 |
dllMapping at:'sqlite3' |
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
283 |
put: 'C:\Program Files\Mozilla Firefox\mozsqlite3.dll' |
19549 | 284 |
for mingw: |
19860
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
285 |
ExternalLibraryFunction |
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
286 |
dllMapping at:'sqlite3' |
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
287 |
put:'C:\mingw64\opt\bin\libsqlite3-0.dll' |
14103 | 288 |
" |
289 |
||
290 |
DllMapping isNil ifTrue:[ |
|
19860
324edacff5cc
unified cpu and os defines;
Claus Gittinger <cg@exept.de>
parents:
19549
diff
changeset
|
291 |
DllMapping := Dictionary new. |
14103 | 292 |
]. |
293 |
^ DllMapping |
|
294 |
||
295 |
"Created: / 10-04-2012 / 12:21:45 / cg" |
|
296 |
! |
|
297 |
||
10270 | 298 |
dllPath |
19549 | 299 |
"provide a default dllPath, where external libraries are searched for" |
300 |
||
13337 | 301 |
^ DLLPATH |
10270 | 302 |
! |
303 |
||
304 |
dllPath:aCollectionOfDirectoryPathNames |
|
19549 | 305 |
"provide a default dllPath, where external libraries are searched for" |
306 |
||
10270 | 307 |
DLLPATH := aCollectionOfDirectoryPathNames |
308 |
! |
|
309 |
||
9463 | 310 |
initialize |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
311 |
"using inline access to corresponding c--defines to avoid duplicate places of knowledge" |
13337 | 312 |
|
313 |
DLLPATH isNil ifTrue:[ |
|
14625 | 314 |
DLLPATH := #('.'). |
18228 | 315 |
%{ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18228
diff
changeset
|
316 |
#ifndef __SCHTEAM__ |
18228 | 317 |
@global(FLAG_VIRTUAL) = __MKSMALLINT(__EXTL_FLAG_VIRTUAL); // a virtual c++ call |
318 |
@global(FLAG_NONVIRTUAL) = __MKSMALLINT(__EXTL_FLAG_NONVIRTUAL); // a non-virtual c++ call |
|
319 |
@global(FLAG_OBJECTIVEC) = __MKSMALLINT(__EXTL_FLAG_OBJECTIVEC); // an objectiveC message send |
|
320 |
@global(FLAG_UNLIMITEDSTACK) = __MKSMALLINT(__EXTL_FLAG_UNLIMITEDSTACK); // unlimitedstack under unix |
|
321 |
@global(FLAG_ASYNC) = __MKSMALLINT(__EXTL_FLAG_ASYNC); // async under win32 |
|
20297
85746bbcaf03
compiler warning eliminated
Claus Gittinger <cg@exept.de>
parents:
20295
diff
changeset
|
322 |
@global(FLAG_RETVAL_IS_CONST) = __MKSMALLINT(__EXTL_FLAG_RETVAL_IS_CONST); // retvalue is not to be registered for finalization |
9463 | 323 |
|
18228 | 324 |
@global(CALLTYPE_API) = __MKSMALLINT(__EXTL_CALLTYPE_API); // WINAPI-call (win32 only) |
325 |
@global(CALLTYPE_C) = __MKSMALLINT(__EXTL_CALLTYPE_C); // regular C-call (the default) |
|
326 |
@global(CALLTYPE_V8) = __MKSMALLINT(__EXTL_CALLTYPE_V8); // v8 call (sparc only) |
|
327 |
@global(CALLTYPE_V9) = __MKSMALLINT(__EXTL_CALLTYPE_V9); // v9 call (sparc only) |
|
328 |
@global(CALLTYPE_UNIX64) = __MKSMALLINT(__EXTL_CALLTYPE_UNIX64); // unix64 call (alpha only) |
|
9463 | 329 |
|
18228 | 330 |
@global(CALLTYPE_MASK) = __MKSMALLINT(__EXTL_CALLTYPE_MASK); |
331 |
#endif |
|
332 |
%} |
|
13337 | 333 |
]. |
9465 | 334 |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
335 |
" |
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
336 |
self initialize |
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
337 |
" |
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
338 |
|
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
339 |
"Modified: / 03-10-2006 / 21:27:47 / cg" |
11053 | 340 |
! |
341 |
||
342 |
removeFromDllPath:aDirectoryPathName |
|
343 |
"remove added places from dll-loading" |
|
344 |
||
345 |
|oldPath| |
|
346 |
||
347 |
oldPath := self dllPath. |
|
348 |
self dllPath:(oldPath asOrderedCollection copyWithout:aDirectoryPathName) |
|
349 |
||
350 |
" |
|
351 |
self dllPath. |
|
11586 | 352 |
self addToDllPath:'C:\aaa\bbb'. |
11053 | 353 |
self dllPath. |
354 |
self removeFromDllPath:'C:\aaa\bbb'. |
|
355 |
self dllPath. |
|
356 |
" |
|
8550 | 357 |
! ! |
358 |
||
9321 | 359 |
!ExternalLibraryFunction class methodsFor:'constants'! |
360 |
||
361 |
callTypeAPI |
|
9463 | 362 |
^ CALLTYPE_API |
9321 | 363 |
|
9463 | 364 |
"Modified: / 01-08-2006 / 13:44:41 / cg" |
9435 | 365 |
! |
366 |
||
9321 | 367 |
callTypeC |
9463 | 368 |
^ CALLTYPE_C |
9321 | 369 |
|
9463 | 370 |
"Modified: / 01-08-2006 / 13:44:49 / cg" |
9435 | 371 |
! |
372 |
||
9321 | 373 |
callTypeCDecl |
9463 | 374 |
^ CALLTYPE_C |
9321 | 375 |
|
9463 | 376 |
"Modified: / 01-08-2006 / 13:44:52 / cg" |
9435 | 377 |
! |
378 |
||
10619 | 379 |
callTypeMASK |
380 |
^ CALLTYPE_MASK |
|
381 |
||
382 |
"Modified: / 01-08-2006 / 13:44:57 / cg" |
|
383 |
! |
|
384 |
||
9321 | 385 |
callTypeOLE |
9463 | 386 |
^ CALLTYPE_OLE |
9435 | 387 |
|
9463 | 388 |
"Modified: / 01-08-2006 / 13:44:57 / cg" |
9321 | 389 |
! ! |
390 |
||
19505 | 391 |
!ExternalLibraryFunction class methodsFor:'debugging'! |
392 |
||
393 |
verbose:aBoolean |
|
394 |
"turn on/off tracing of calls" |
|
395 |
||
396 |
Verbose := aBoolean |
|
397 |
||
398 |
" |
|
399 |
ExternalLibraryFunction verbose:true |
|
400 |
" |
|
401 |
||
402 |
"Created: / 30-03-2016 / 17:28:23 / cg" |
|
403 |
! ! |
|
404 |
||
19490 | 405 |
!ExternalLibraryFunction class methodsFor:'type name mapping'! |
406 |
||
407 |
ffiTypeSymbolForType:aType |
|
408 |
"map type to one of the ffi-supported ones: |
|
19535 | 409 |
sint8, sint16, sint32, sint64 |
410 |
uint8, uint16, uint32, uint64 |
|
411 |
bool void pointer handle |
|
19490 | 412 |
" |
413 |
||
414 |
aType == #sint8 ifTrue:[^ aType ]. |
|
415 |
aType == #sint16 ifTrue:[^ aType ]. |
|
416 |
aType == #sint32 ifTrue:[^ aType ]. |
|
417 |
aType == #sint64 ifTrue:[^ aType ]. |
|
418 |
aType == #uint8 ifTrue:[^ aType ]. |
|
419 |
aType == #uint16 ifTrue:[^ aType ]. |
|
420 |
aType == #uint32 ifTrue:[^ aType ]. |
|
421 |
aType == #uint64 ifTrue:[^ aType ]. |
|
422 |
aType == #double ifTrue:[^ aType ]. |
|
423 |
aType == #float ifTrue:[^ aType ]. |
|
424 |
aType == #char ifTrue:[^ aType ]. |
|
425 |
aType == #void ifTrue:[^ aType ]. |
|
426 |
aType == #bool ifTrue:[^ aType ]. |
|
427 |
aType == #pointer ifTrue:[^ aType ]. |
|
428 |
aType == #charPointer ifTrue:[^ aType ]. |
|
429 |
aType == #wcharPointer ifTrue:[^ aType ]. |
|
430 |
||
431 |
aType == #int8 ifTrue:[^ #sint8 ]. |
|
432 |
aType == #int16 ifTrue:[^ #sint16 ]. |
|
433 |
aType == #int32 ifTrue:[^ #sint32 ]. |
|
434 |
aType == #int64 ifTrue:[^ #sint64 ]. |
|
435 |
||
436 |
aType == #voidPointer ifTrue:[^ #pointer ]. |
|
437 |
aType == #uint8Pointer ifTrue:[^ #pointer ]. |
|
438 |
aType == #voidPointerPointer ifTrue:[^ #pointer ]. |
|
439 |
||
440 |
aType == #short ifTrue:[^ #sint16 ]. |
|
441 |
aType == #long ifTrue:[^ #long ]. |
|
442 |
aType == #int ifTrue:[^ #int ]. |
|
443 |
aType == #uint ifTrue:[^ #uint ]. |
|
444 |
aType == #ushort ifTrue:[^ #uint16 ]. |
|
445 |
aType == #unsignedShort ifTrue:[^ #uint16 ]. |
|
446 |
aType == #ulong ifTrue:[^ #ulong ]. |
|
447 |
aType == #unsignedLong ifTrue:[^ #ulong ]. |
|
448 |
aType == #uchar ifTrue:[^ #uint8 ]. |
|
449 |
aType == #unsignedChar ifTrue:[^ #uint8 ]. |
|
450 |
aType == #byte ifTrue:[^ #uint8 ]. |
|
451 |
aType == #longlong ifTrue:[^ #sint64 ]. |
|
452 |
aType == #longLong ifTrue:[^ #sint64 ]. |
|
453 |
aType == #ulonglong ifTrue:[^ #uint64 ]. |
|
454 |
aType == #ulongLong ifTrue:[^ #uint64 ]. |
|
455 |
||
456 |
"/ windefs |
|
457 |
aType == #dword ifTrue:[^ #uint32 ]. |
|
458 |
aType == #sdword ifTrue:[^ #sint32 ]. |
|
459 |
aType == #word ifTrue:[^ #uint16 ]. |
|
460 |
aType == #sword ifTrue:[^ #sint16 ]. |
|
461 |
aType == #handle ifTrue:[^ #pointer ]. |
|
462 |
aType == #lpstr ifTrue:[^ #charPointer ]. |
|
19501 | 463 |
"/ aType == #hresult ifTrue:[^ #uint32 ]. -- keep this; it is translated later (in invoke) |
19490 | 464 |
aType == #boolean ifTrue:[^ #bool ]. |
465 |
"/ care for 64bit machines |
|
466 |
aType == #ulongReturn ifTrue:[^ ExternalAddress pointerSize == 8 ifTrue:[#uint64] ifFalse:[#uint32]]. |
|
467 |
aType == #none ifTrue:[^ #void ]. |
|
468 |
aType == #struct ifTrue:[^ #pointer ]. |
|
469 |
aType == #structIn ifTrue:[^ #pointer ]. |
|
470 |
aType == #structOut ifTrue:[^ #pointer ]. |
|
471 |
aType == #structInOut ifTrue:[^ #pointer ]. |
|
472 |
aType == #unsigned ifTrue:[^ #uint ]. |
|
473 |
||
474 |
aType == #ATOM ifTrue:[^ #uint16 ]. |
|
475 |
aType == #BOOL ifTrue:[^ #int ]. |
|
476 |
aType == #BOOLEAN ifTrue:[^ #uint8 ]. |
|
477 |
aType == #BYTE ifTrue:[^ #uint8 ]. |
|
478 |
aType == #DWORD ifTrue:[^ #uint32 ]. |
|
479 |
aType == #HANDLE ifTrue:[^ #pointer ]. |
|
19535 | 480 |
aType == #HRESULT ifTrue:[^ #hresult ]. |
19501 | 481 |
|
19490 | 482 |
"/ care for 64bit machines |
483 |
aType == #SIZE_T ifTrue:[^ ExternalAddress pointerSize == 8 ifTrue:[#uint64] ifFalse:[#uint32]]. |
|
19494 | 484 |
aType == #BSTR ifTrue:[^ #wcharPointer]. |
19490 | 485 |
|
486 |
(aType isString or:[aType isSymbol]) ifFalse:[ |
|
19535 | 487 |
CType isNil ifTrue:[ |
488 |
self error:'unknown type'. |
|
489 |
]. |
|
490 |
^ aType typeSymbol. |
|
19490 | 491 |
]. |
492 |
||
493 |
(aType endsWith:'*') ifTrue:[ |
|
19535 | 494 |
^ #pointer. |
19490 | 495 |
]. |
496 |
(aType endsWith:'Pointer') ifTrue:[ |
|
19535 | 497 |
^ #pointer. |
19490 | 498 |
]. |
499 |
^ aType |
|
500 |
||
19501 | 501 |
"Modified (format): / 30-03-2016 / 13:45:09 / cg" |
19490 | 502 |
! ! |
503 |
||
9321 | 504 |
!ExternalLibraryFunction methodsFor:'accessing'! |
505 |
||
506 |
argumentTypes |
|
507 |
^ argumentTypes |
|
9463 | 508 |
! |
509 |
||
11426 | 510 |
argumentTypesString |
11586 | 511 |
^ String |
512 |
streamContents:[:s | |
|
513 |
argumentTypes do:[:eachArgType | |
|
514 |
eachArgType printOn:s. |
|
515 |
] separatedBy:[ |
|
516 |
s nextPutAll:','. |
|
517 |
]. |
|
518 |
]. |
|
11426 | 519 |
! |
520 |
||
9463 | 521 |
beAsync |
522 |
"let this execute in a separate thread, in par with the other execution thread(s). |
|
523 |
Ignored under unix/linux (until those support multiple threads too)." |
|
524 |
||
525 |
flags := (flags ? 0) bitOr: FLAG_ASYNC. |
|
526 |
||
527 |
"Created: / 01-08-2006 / 13:42:38 / cg" |
|
528 |
! |
|
529 |
||
9465 | 530 |
beCallTypeAPI |
531 |
flags := (flags ? 0) bitOr: CALLTYPE_API. |
|
532 |
||
533 |
"Created: / 01-08-2006 / 15:12:40 / cg" |
|
534 |
! |
|
535 |
||
536 |
beCallTypeC |
|
537 |
flags := (flags ? 0) bitOr: CALLTYPE_C. |
|
538 |
||
539 |
"Created: / 01-08-2006 / 15:12:40 / cg" |
|
540 |
! |
|
541 |
||
10481 | 542 |
beCallTypeOLE |
543 |
flags := (flags ? 0) bitOr: FLAG_VIRTUAL. |
|
544 |
||
545 |
"Created: / 01-08-2006 / 15:12:40 / cg" |
|
546 |
! |
|
547 |
||
9465 | 548 |
beCallTypeUNIX64 |
549 |
flags := (flags ? 0) bitOr: CALLTYPE_UNIX64. |
|
550 |
||
551 |
"Created: / 01-08-2006 / 15:13:38 / cg" |
|
552 |
! |
|
553 |
||
554 |
beCallTypeV8 |
|
555 |
flags := (flags ? 0) bitOr: CALLTYPE_V8. |
|
556 |
||
557 |
"Created: / 01-08-2006 / 15:13:28 / cg" |
|
558 |
! |
|
559 |
||
560 |
beCallTypeV9 |
|
561 |
flags := (flags ? 0) bitOr: CALLTYPE_V9. |
|
562 |
||
563 |
"Created: / 01-08-2006 / 15:13:31 / cg" |
|
564 |
! |
|
565 |
||
566 |
beCallTypeWINAPI |
|
567 |
self beCallTypeAPI |
|
568 |
||
569 |
"Modified: / 01-08-2006 / 15:14:02 / cg" |
|
570 |
! |
|
571 |
||
9525 | 572 |
beConstReturnValue |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
573 |
"specify that a pointer return value is not to be finalized |
9525 | 574 |
(i.e. points to static data or data which is freed by c)" |
575 |
||
576 |
flags := (flags ? 0) bitOr: FLAG_RETVAL_IS_CONST. |
|
577 |
||
578 |
"Created: / 01-08-2006 / 13:56:48 / cg" |
|
579 |
! |
|
580 |
||
9463 | 581 |
beNonVirtualCPP |
582 |
"specify this as a non-virtual c++-function" |
|
583 |
||
584 |
flags := (flags ? 0) bitOr: FLAG_NONVIRTUAL. |
|
585 |
||
586 |
"Created: / 01-08-2006 / 13:56:44 / cg" |
|
587 |
! |
|
588 |
||
19311 | 589 |
beObjectiveC |
590 |
"specify this as an objective-c message send" |
|
591 |
||
592 |
flags := (flags ? 0) bitOr: FLAG_OBJECTIVEC. |
|
593 |
||
594 |
"Created: / 01-08-2006 / 13:56:48 / cg" |
|
595 |
! |
|
596 |
||
9463 | 597 |
beUnlimitedStack |
598 |
"let this execute on the c-stack (as opposed to the thread-stack) |
|
599 |
for unlimited auto-sized-stack under unix/linux. |
|
600 |
Ignored under windows." |
|
601 |
||
602 |
flags := (flags ? 0) bitOr: FLAG_UNLIMITEDSTACK. |
|
603 |
||
604 |
"Created: / 01-08-2006 / 13:41:54 / cg" |
|
605 |
! |
|
606 |
||
607 |
beVirtualCPP |
|
608 |
"specify this as a virtual c++-function" |
|
609 |
||
610 |
flags := (flags ? 0) bitOr: FLAG_VIRTUAL. |
|
611 |
||
612 |
"Created: / 01-08-2006 / 13:56:48 / cg" |
|
613 |
! |
|
614 |
||
9465 | 615 |
callTypeNumber |
616 |
^ (flags ? 0) bitAnd: CALLTYPE_MASK. |
|
617 |
||
618 |
"Created: / 01-08-2006 / 15:12:10 / cg" |
|
619 |
! |
|
620 |
||
9463 | 621 |
isAsync |
622 |
"is this executed in a separate thread, in par with the other execution thread(s) ?" |
|
623 |
||
624 |
^ (flags ? 0) bitTest: FLAG_ASYNC. |
|
625 |
||
626 |
"Created: / 01-08-2006 / 13:46:53 / cg" |
|
627 |
! |
|
628 |
||
9519 | 629 |
isCPPFunction |
630 |
"is this a virtual or non-virtual c++-function ?" |
|
631 |
||
632 |
^ (flags ? 0) bitTest: (FLAG_VIRTUAL bitOr: FLAG_NONVIRTUAL). |
|
633 |
||
634 |
"Created: / 01-08-2006 / 13:56:54 / cg" |
|
635 |
! |
|
636 |
||
9465 | 637 |
isCallTypeAPI |
19490 | 638 |
"is this a windows API-call linkage call. |
639 |
Attention: this uses a different call API (callee unwinds the stack), |
|
640 |
and MUST be declared as such for many Kernel functions. |
|
641 |
The calltype API is one of the worst historic garbage kept by MS..." |
|
642 |
||
9465 | 643 |
^ ((flags ? 0) bitAnd: CALLTYPE_MASK) == CALLTYPE_API. |
644 |
||
645 |
"Created: / 01-08-2006 / 15:21:16 / cg" |
|
646 |
! |
|
647 |
||
648 |
isCallTypeC |
|
19490 | 649 |
"is this a regular C-call (attention: on windows, there are two kinds of calls)" |
650 |
||
9465 | 651 |
^ ((flags ? 0) bitAnd: CALLTYPE_MASK) == CALLTYPE_C. |
652 |
||
653 |
"Created: / 01-08-2006 / 15:21:23 / cg" |
|
654 |
! |
|
655 |
||
10483 | 656 |
isCallTypeOLE |
19490 | 657 |
"is this an OLE-object call ? (eg. a virtual c++ call; same as isCallTypeCPP)" |
658 |
||
10483 | 659 |
^ ((flags ? 0) bitTest: FLAG_VIRTUAL). |
660 |
||
661 |
"Created: / 01-08-2006 / 15:21:23 / cg" |
|
662 |
! |
|
663 |
||
9525 | 664 |
isConstReturnValue |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
665 |
"is the pointer return value not to be finalized |
9525 | 666 |
(i.e. points to static data or data which is freed by c)" |
667 |
||
668 |
^ (flags ? 0) bitTest: FLAG_RETVAL_IS_CONST. |
|
669 |
||
670 |
"Created: / 01-08-2006 / 13:56:48 / cg" |
|
671 |
! |
|
672 |
||
9463 | 673 |
isNonVirtualCPP |
674 |
"is this a non-virtual c++-function ?" |
|
675 |
||
676 |
^ (flags ? 0) bitTest: FLAG_NONVIRTUAL. |
|
677 |
||
678 |
"Created: / 01-08-2006 / 13:56:51 / cg" |
|
679 |
! |
|
680 |
||
19311 | 681 |
isObjectiveC |
682 |
"is this an objective-C message?" |
|
683 |
||
684 |
^ (flags ? 0) bitTest: FLAG_OBJECTIVEC. |
|
685 |
! |
|
686 |
||
9463 | 687 |
isUnlimitedStack |
688 |
"will this execute on the c-stack (as opposed to the thread-stack) |
|
689 |
for unlimited auto-sized-stack under unix/linux. |
|
690 |
Ignored under windows." |
|
691 |
||
692 |
^ (flags ? 0) bitTest: FLAG_UNLIMITEDSTACK. |
|
693 |
||
694 |
"Created: / 01-08-2006 / 14:17:07 / cg" |
|
695 |
! |
|
696 |
||
697 |
isVirtualCPP |
|
19490 | 698 |
"is this a virtual c++-function (same as isCallTypeOLE) ?" |
9463 | 699 |
|
700 |
^ (flags ? 0) bitTest: FLAG_VIRTUAL. |
|
701 |
||
702 |
"Created: / 01-08-2006 / 13:56:54 / cg" |
|
10483 | 703 |
! |
704 |
||
11426 | 705 |
moduleName |
706 |
^ moduleName |
|
707 |
! |
|
708 |
||
10484 | 709 |
returnType |
710 |
^ returnType |
|
711 |
! |
|
712 |
||
10483 | 713 |
vtableIndex |
714 |
name isNumber ifFalse:[^ nil]. |
|
715 |
^ name. |
|
9321 | 716 |
! ! |
717 |
||
20289 | 718 |
|
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
719 |
!ExternalLibraryFunction methodsFor:'invoking'! |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
720 |
|
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
721 |
invoke |
9321 | 722 |
self hasCode ifFalse:[ |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
723 |
self prepareInvoke. |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
724 |
]. |
19311 | 725 |
^ self invokeFFIwithArguments:nil forCPPInstance:nil |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
726 |
! |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
727 |
|
9347 | 728 |
invokeCPPVirtualOn:anInstance |
9341 | 729 |
self hasCode ifFalse:[ |
11586 | 730 |
self prepareInvoke. |
9341 | 731 |
]. |
10440 | 732 |
^ self invokeCPPVirtualFFIOn:anInstance withArguments:nil |
9341 | 733 |
! |
734 |
||
9347 | 735 |
invokeCPPVirtualOn:instance with:arg |
9341 | 736 |
self hasCode ifFalse:[ |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
737 |
self prepareInvoke. |
9341 | 738 |
]. |
9347 | 739 |
^ self invokeCPPVirtualFFIOn:instance withArguments:(Array with:arg) |
9341 | 740 |
! |
741 |
||
9347 | 742 |
invokeCPPVirtualOn:instance with:arg1 with:arg2 |
9341 | 743 |
self hasCode ifFalse:[ |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
744 |
self prepareInvoke. |
9341 | 745 |
]. |
9347 | 746 |
^ self invokeCPPVirtualFFIOn:instance withArguments:(Array with:arg1 with:arg2) |
9341 | 747 |
! |
748 |
||
9347 | 749 |
invokeCPPVirtualOn:instance with:arg1 with:arg2 with:arg3 |
9341 | 750 |
self hasCode ifFalse:[ |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
751 |
self prepareInvoke. |
9341 | 752 |
]. |
9347 | 753 |
^ self invokeCPPVirtualFFIOn:instance withArguments:(Array with:arg1 with:arg2 with:arg3) |
9341 | 754 |
! |
755 |
||
9347 | 756 |
invokeCPPVirtualOn:instance with:arg1 with:arg2 with:arg3 with:arg4 |
9341 | 757 |
self hasCode ifFalse:[ |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
758 |
self prepareInvoke. |
9341 | 759 |
]. |
9347 | 760 |
^ self invokeCPPVirtualFFIOn:instance withArguments:(Array with:arg1 with:arg2 with:arg3 with:arg4) |
9341 | 761 |
! |
762 |
||
10481 | 763 |
invokeCPPVirtualOn:instance withArguments:args |
764 |
self hasCode ifFalse:[ |
|
11586 | 765 |
self prepareInvoke. |
10481 | 766 |
]. |
767 |
^ self invokeCPPVirtualFFIOn:instance withArguments:args |
|
768 |
! |
|
769 |
||
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
770 |
invokeWith:arg |
9321 | 771 |
self hasCode ifFalse:[ |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
772 |
self prepareInvoke. |
9321 | 773 |
]. |
19311 | 774 |
^ self invokeFFIwithArguments:(Array with:arg) forCPPInstance:nil |
9321 | 775 |
! |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
776 |
|
9321 | 777 |
invokeWith:arg1 with:arg2 |
778 |
self hasCode ifFalse:[ |
|
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
779 |
self prepareInvoke. |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
780 |
]. |
19311 | 781 |
^ self invokeFFIwithArguments:(Array with:arg1 with:arg2) forCPPInstance:nil |
9321 | 782 |
! |
783 |
||
784 |
invokeWith:arg1 with:arg2 with:arg3 |
|
785 |
self hasCode ifFalse:[ |
|
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
786 |
self prepareInvoke. |
9321 | 787 |
]. |
19311 | 788 |
^ self invokeFFIwithArguments:(Array with:arg1 with:arg2 with:arg3) forCPPInstance:nil |
9321 | 789 |
! |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
790 |
|
9321 | 791 |
invokeWith:arg1 with:arg2 with:arg3 with:arg4 |
792 |
self hasCode ifFalse:[ |
|
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
793 |
self prepareInvoke. |
9321 | 794 |
]. |
19311 | 795 |
^ self invokeFFIwithArguments:(Array with:arg1 with:arg2 with:arg3 with:arg4) forCPPInstance:nil |
9321 | 796 |
! |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
797 |
|
9321 | 798 |
invokeWithArguments:argArray |
799 |
self hasCode ifFalse:[ |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
800 |
self prepareInvoke. |
9321 | 801 |
]. |
9465 | 802 |
^ self invokeFFIwithArguments:argArray forCPPInstance:nil |
803 |
||
804 |
"Modified: / 01-08-2006 / 16:04:08 / cg" |
|
9321 | 805 |
! ! |
806 |
||
807 |
!ExternalLibraryFunction methodsFor:'printing'! |
|
808 |
||
809 |
printOn:aStream |
|
810 |
aStream nextPutAll:'<'. |
|
9465 | 811 |
self isCallTypeAPI ifTrue:[ |
14625 | 812 |
'API:' printOn:aStream. |
9465 | 813 |
] ifFalse:[ |
14625 | 814 |
self isCallTypeOLE ifTrue:[ |
815 |
'OLE:' printOn:aStream. |
|
816 |
] ifFalse:[ |
|
817 |
self isCallTypeC ifTrue:[ |
|
818 |
'C:' printOn:aStream. |
|
819 |
] ifFalse:[ |
|
820 |
self error. |
|
821 |
]. |
|
822 |
]. |
|
9465 | 823 |
]. |
9321 | 824 |
aStream nextPutAll:' '. |
825 |
name printOn:aStream. |
|
9465 | 826 |
moduleName notNil ifTrue:[ |
14625 | 827 |
aStream nextPutAll:' module:'. |
828 |
moduleName printOn:aStream. |
|
9465 | 829 |
]. |
9321 | 830 |
aStream nextPutAll:'>'. |
9465 | 831 |
|
14356 | 832 |
"Modified: / 25-09-2012 / 12:06:14 / cg" |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
833 |
! ! |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
834 |
|
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
835 |
!ExternalLibraryFunction methodsFor:'private'! |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
836 |
|
10213 | 837 |
adjustTypes |
19490 | 838 |
"map all those existing type names to a small number of definite ffi type names. |
839 |
This is needed, because there are so many different C-type names found in code imported |
|
840 |
from various Smalltalk dialects' library function call declarations. |
|
841 |
For example: all of word, WORD, unsignedShort, ushort, uShort etc. will map to uint16. |
|
842 |
Also, this deals with pointer size differences." |
|
843 |
||
19313 | 844 |
argumentTypes notEmptyOrNil ifTrue:[ |
19535 | 845 |
argumentTypes := argumentTypes collect:[:argType | self class ffiTypeSymbolForType:argType]. |
10213 | 846 |
]. |
19490 | 847 |
returnType := self class ffiTypeSymbolForType:returnType. |
10213 | 848 |
! |
849 |
||
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
850 |
linkToModule |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
851 |
"link this function to the external module. |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
852 |
I.e. retrieve the module handle and the code pointer." |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
853 |
|
9465 | 854 |
|handle moduleNameUsed functionName| |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
855 |
|
10481 | 856 |
name isNumber ifTrue:[ |
19535 | 857 |
self isCPPFunction ifTrue:[ |
858 |
"/ no need to load a dll. |
|
859 |
^ self |
|
860 |
] |
|
10481 | 861 |
]. |
862 |
||
13782
1994fe87f21e
comment/format in: #linkToModule
Claus Gittinger <cg@exept.de>
parents:
13412
diff
changeset
|
863 |
"/ in some other smalltalks, there is no moduleName in the ffi-spec; |
1994fe87f21e
comment/format in: #linkToModule
Claus Gittinger <cg@exept.de>
parents:
13412
diff
changeset
|
864 |
"/ instead, the class provides the libraryName... |
9465 | 865 |
(moduleNameUsed := moduleName) isNil ifTrue:[ |
19535 | 866 |
owningClass isNil ifTrue:[ |
867 |
self error:'Missing moduleName'. |
|
868 |
]. |
|
869 |
moduleNameUsed := owningClass theNonMetaclass libraryName asSymbol. |
|
9321 | 870 |
]. |
11586 | 871 |
moduleHandle isNil ifTrue:[ |
19535 | 872 |
"/ speedup. in 95% of all calls, the same moduleName is resolved here |
873 |
(LastModuleHandleHolder isNil |
|
874 |
or:[ (handle := LastModuleHandleHolder at:1) isNil |
|
875 |
or:[ LastModuleHandleName ~= moduleNameUsed ]]) ifTrue:[ |
|
19342 | 876 |
|
19535 | 877 |
handle := self loadLibrary:moduleNameUsed. |
878 |
handle isNil ifTrue:[ |
|
879 |
self error:('Cannot find or load dll/module: "%1"' bindWith: moduleNameUsed). |
|
880 |
]. |
|
881 |
LastModuleHandleHolder := WeakArray with:handle. |
|
882 |
LastModuleHandleName := moduleNameUsed. |
|
883 |
]. |
|
884 |
moduleHandle := handle. |
|
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
885 |
]. |
9341 | 886 |
name isNumber ifFalse:[ |
19535 | 887 |
functionName := name. |
888 |
(moduleHandle getFunctionAddress:functionName into:self) isNil ifTrue:[ |
|
889 |
(moduleHandle getFunctionAddress:('_', functionName) into:self) isNil ifTrue:[ |
|
890 |
moduleHandle := nil. |
|
891 |
self error:'Missing function: ', name, ' in module: ', moduleNameUsed. |
|
892 |
]. |
|
893 |
]. |
|
9321 | 894 |
]. |
9392 | 895 |
|
14103 | 896 |
"Modified: / 10-04-2012 / 12:12:44 / cg" |
9321 | 897 |
! |
898 |
||
10270 | 899 |
loadLibrary:dllName |
19490 | 900 |
"load a dll. |
901 |
Notice the dllMapping mechanism, which can be used to silently load different dlls. |
|
902 |
This is useful, if some code has a hardcoded dll-name in it, which needs to be changed, |
|
903 |
but you do not want or cannot recompile the methods (i.e. no source avail)" |
|
904 |
||
12436 | 905 |
|handle nameString filename| |
10279
60c42983fdd4
first test whether the dllName is the complete filename
ca
parents:
10270
diff
changeset
|
906 |
|
14103 | 907 |
filename := dllName. |
908 |
DllMapping notNil ifTrue:[ |
|
19535 | 909 |
filename := DllMapping at:filename ifAbsent:[ filename ] |
14103 | 910 |
]. |
911 |
||
912 |
filename := filename asFilename. |
|
12436 | 913 |
nameString := filename name. |
10279
60c42983fdd4
first test whether the dllName is the complete filename
ca
parents:
10270
diff
changeset
|
914 |
|
12937 | 915 |
"try to load, maybe the system knows where to find the dll" |
916 |
handle := ObjectFileLoader loadDynamicObject:filename. |
|
917 |
handle notNil ifTrue:[^ handle ]. |
|
918 |
||
12436 | 919 |
filename isAbsolute ifFalse:[ |
19535 | 920 |
"First ask the class defining the ExternalFunction for the location of the dlls ..." |
921 |
owningClass notNil ifTrue:[ |
|
922 |
owningClass dllPath do:[:eachDirectory | |
|
923 |
handle := ObjectFileLoader |
|
924 |
loadDynamicObject:(eachDirectory asFilename construct:nameString) pathName. |
|
925 |
handle notNil ifTrue:[^ handle ]. |
|
926 |
]. |
|
927 |
]. |
|
928 |
".. then ask the system" |
|
929 |
self class dllPath do:[:eachDirectory | |
|
930 |
handle := ObjectFileLoader |
|
931 |
loadDynamicObject:(eachDirectory asFilename construct:nameString) pathName. |
|
932 |
handle notNil ifTrue:[^ handle ]. |
|
933 |
]. |
|
10279
60c42983fdd4
first test whether the dllName is the complete filename
ca
parents:
10270
diff
changeset
|
934 |
]. |
10270 | 935 |
|
12436 | 936 |
filename suffix isEmpty ifTrue:[ |
19535 | 937 |
"/ try again with the OS-specific dll-extension |
938 |
^ self loadLibrary:(filename withSuffix:ObjectFileLoader sharedLibrarySuffix) |
|
10270 | 939 |
]. |
12436 | 940 |
|
10270 | 941 |
^ nil |
14103 | 942 |
|
943 |
"Modified: / 10-04-2012 / 12:21:06 / cg" |
|
10270 | 944 |
! |
945 |
||
9321 | 946 |
prepareInvoke |
19490 | 947 |
"called before invoked. |
19535 | 948 |
When called the very first time, moduleHandle is nil, |
19490 | 949 |
and we ensure that the dll is loaded, the function address is extracted" |
950 |
||
10270 | 951 |
(moduleHandle isNil or:[self hasCode not]) ifTrue:[ |
19535 | 952 |
self linkToModule. |
953 |
self adjustTypes. |
|
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
954 |
]. |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
955 |
! ! |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
956 |
|
8550 | 957 |
!ExternalLibraryFunction methodsFor:'private-accessing'! |
958 |
||
9466 | 959 |
name:functionNameOrVirtualIndex module:aModuleName returnType:aReturnType argumentTypes:argTypes |
960 |
name := functionNameOrVirtualIndex. |
|
961 |
functionNameOrVirtualIndex isNumber ifTrue:[ |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
962 |
self beVirtualCPP. |
9466 | 963 |
]. |
8891
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
964 |
moduleName := aModuleName. |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
965 |
returnType := aReturnType. |
c30a030ff5ec
more FFI (foreign function interface) support - still incomplete
Stefan Vogel <sv@exept.de>
parents:
8728
diff
changeset
|
966 |
argumentTypes := argTypes. |
9465 | 967 |
|
968 |
"Created: / 01-08-2006 / 15:19:52 / cg" |
|
9466 | 969 |
"Modified: / 02-08-2006 / 17:20:13 / cg" |
9465 | 970 |
! |
971 |
||
11426 | 972 |
owningClass |
973 |
^ owningClass |
|
974 |
! |
|
975 |
||
9465 | 976 |
owningClass:aClass |
977 |
owningClass := aClass. |
|
978 |
||
979 |
"Created: / 01-08-2006 / 15:22:50 / cg" |
|
10603 | 980 |
! |
981 |
||
11586 | 982 |
setModuleName:aModuleName |
10603 | 983 |
aModuleName ~= moduleName ifTrue:[ |
11586 | 984 |
self code:nil. |
985 |
moduleHandle := nil. |
|
986 |
moduleName := aModuleName. |
|
10603 | 987 |
]. |
988 |
||
989 |
"Created: / 07-06-2007 / 10:20:17 / cg" |
|
8550 | 990 |
! ! |
991 |
||
9342 | 992 |
!ExternalLibraryFunction methodsFor:'private-invoking'! |
993 |
||
9347 | 994 |
invokeCPPVirtualFFIOn:instance withArguments:arguments |
9463 | 995 |
^ self invokeFFIwithArguments:arguments forCPPInstance:instance |
996 |
||
997 |
"Modified: / 01-08-2006 / 13:55:30 / cg" |
|
9342 | 998 |
! |
999 |
||
9347 | 1000 |
invokeFFIWithArguments:arguments |
9463 | 1001 |
^ self invokeFFIwithArguments:arguments forCPPInstance:nil |
1002 |
||
1003 |
"Modified: / 01-08-2006 / 13:55:35 / cg" |
|
9347 | 1004 |
! |
1005 |
||
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1006 |
invokeFFIwithArguments:argumentsOrNil forCPPInstance:aReceiverOrNil |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1007 |
"basic invoke mechanism. Calls the function represented by the receiver with argumentsOrNil. |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1008 |
For cplusplus, aReceiverOrNil is required to be an externalStructure like object; |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1009 |
for objectiveC, it must be an ObjectiveC object" |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1010 |
|
19341
2ab29dd7ec1a
mingw 64bit fixes (xxLL in constants - sigh)
Claus Gittinger <cg@exept.de>
parents:
19334
diff
changeset
|
1011 |
|argTypeSymbols returnTypeSymbol failureCode failureArgNr failureInfo returnValue stClass vtOffset |
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1012 |
virtual objectiveC async unlimitedStack callTypeNumber returnValueClass argValueClass |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1013 |
oldReturnType oldArgumentTypes| |
9342 | 1014 |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
1015 |
argTypeSymbols := argumentTypes. |
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
1016 |
returnTypeSymbol := returnType. |
9346 | 1017 |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
1018 |
virtual := self isVirtualCPP. |
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1019 |
objectiveC := self isObjectiveC. |
9524 | 1020 |
(virtual "or:[self isNonVirtualCPP]") ifTrue:[ |
19535 | 1021 |
aReceiverOrNil isNil ifTrue:[ |
1022 |
"/ must have a c++ object instance |
|
1023 |
self primitiveFailed. |
|
1024 |
]. |
|
9463 | 1025 |
|
19535 | 1026 |
"/ and it must be a kind of ExternalStructure !! |
1027 |
(aReceiverOrNil isKindOf:ExternalStructure) ifFalse:[ |
|
1028 |
self primitiveFailed. |
|
1029 |
]. |
|
1030 |
virtual ifTrue:[ |
|
1031 |
vtOffset := name. |
|
1032 |
(vtOffset between:0 and:10000) ifFalse:[ |
|
1033 |
self primitiveFailed. |
|
1034 |
] |
|
1035 |
]. |
|
9463 | 1036 |
] ifFalse:[ |
19535 | 1037 |
objectiveC ifTrue:[ |
1038 |
aReceiverOrNil isNil ifTrue:[ |
|
1039 |
"/ must have an objective-c object instance |
|
1040 |
self primitiveFailed. |
|
1041 |
]. |
|
1042 |
(aReceiverOrNil isObjectiveCObject) ifFalse:[ |
|
1043 |
self primitiveFailed |
|
1044 |
] |
|
1045 |
] ifFalse:[ |
|
1046 |
aReceiverOrNil notNil ifTrue:[ |
|
1047 |
"/ must NOT have a c++/objectiveC object instance |
|
1048 |
self primitiveFailed. |
|
1049 |
] |
|
1050 |
]. |
|
9342 | 1051 |
]. |
9463 | 1052 |
async := self isAsync. |
1053 |
unlimitedStack := self isUnlimitedStack. |
|
9465 | 1054 |
callTypeNumber := self callTypeNumber. |
10512 | 1055 |
"/ Transcript show:name; show:' async:'; showCR:async. |
9342 | 1056 |
|
9459
6cd520c582b3
change from unlimited to big stack, to allow for interrupts to be handled
ca
parents:
9436
diff
changeset
|
1057 |
%{ /* STACK: 100000 */ |
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1058 |
|
19931 | 1059 |
#define VERBOSE |
1060 |
||
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
1061 |
#ifdef HAVE_FFI |
19931 | 1062 |
|
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1063 |
# ifdef __GNUC__ |
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1064 |
# ifndef HAS_LONGLONG |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1065 |
# define HAS_LONGLONG |
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1066 |
# endif |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1067 |
# endif |
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1068 |
# if defined(__BORLANDC__) || defined(__VISUALC__) |
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1069 |
# define HAS_INT64 |
19364 | 1070 |
# ifndef __LO32 |
1071 |
# define __LO32(ll) ((ll) & 0xFFFFFFFFL) |
|
1072 |
# define __HI32(ll) (((ll)>>32) & 0xFFFFFFFFL) |
|
1073 |
# endif |
|
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1074 |
# endif |
19931 | 1075 |
|
1076 |
||
9342 | 1077 |
ffi_cif __cif; |
1078 |
ffi_type *__argTypesIncludingThis[MAX_ARGS+1]; |
|
1079 |
ffi_type **__argTypes = __argTypesIncludingThis; |
|
1080 |
ffi_type *__returnType = NULL; |
|
19931 | 1081 |
ffi_type *thisType; |
1082 |
ffi_abi __callType = FFI_DEFAULT_ABI; |
|
1083 |
||
1084 |
#else |
|
1085 |
||
1086 |
int __argTypesIncludingThis[MAX_ARGS+1]; |
|
1087 |
int *__argTypes = __argTypesIncludingThis; |
|
1088 |
int __returnType = 0; |
|
1089 |
int thisType; |
|
1090 |
int __callType = FFI_DEFAULT_ABI; |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1091 |
|
19951 | 1092 |
#endif |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1093 |
|
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1094 |
int __numFloatOrDoubleArgs = 0; |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1095 |
|
9342 | 1096 |
union u { |
19535 | 1097 |
INT iVal; |
1098 |
float fVal; |
|
1099 |
double dVal; |
|
1100 |
void *pointerVal; |
|
19365
83a120bf2212
Fix syntax error bug with gcc32
Stefan Vogel <sv@exept.de>
parents:
19364
diff
changeset
|
1101 |
# if 0 && defined(HAS_LONGLONG) |
19535 | 1102 |
long long longLongVal; |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1103 |
# else |
19535 | 1104 |
__int64__ longLongVal; |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1105 |
# endif |
9342 | 1106 |
}; |
1107 |
union u __argValuesIncludingThis[MAX_ARGS+1]; |
|
1108 |
union u *__argValues = __argValuesIncludingThis; |
|
1109 |
union u __returnValue; |
|
1110 |
void *__argValuePointersIncludingThis[MAX_ARGS+1]; |
|
1111 |
void **__argValuePointers = __argValuePointersIncludingThis; |
|
1112 |
void *__returnValuePointer; |
|
1113 |
int __numArgs, __numArgsIncludingThis; |
|
19311 | 1114 |
static INT null = 0; |
19341
2ab29dd7ec1a
mingw 64bit fixes (xxLL in constants - sigh)
Claus Gittinger <cg@exept.de>
parents:
19334
diff
changeset
|
1115 |
int i = -1; |
9342 | 1116 |
VOIDFUNC codeAddress = (VOIDFUNC)__INST(code_); |
10440 | 1117 |
int __numArgsWanted; |
12579
516bba5b3e57
changed: #ffiTypeSymbolForType:
Claus Gittinger <cg@exept.de>
parents:
12504
diff
changeset
|
1118 |
|
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1119 |
# define __FAIL__(fcode) \ |
10603 | 1120 |
{ \ |
19535 | 1121 |
failureCode = fcode; failureArgNr = __mkSmallInteger(i+1); goto getOutOfHere; \ |
10603 | 1122 |
} |
9342 | 1123 |
|
10440 | 1124 |
if (argumentsOrNil == nil) { |
19535 | 1125 |
__numArgs = 0; |
10440 | 1126 |
} else if (__isArray(argumentsOrNil)) { |
19535 | 1127 |
__numArgs = __arraySize(argumentsOrNil); |
9342 | 1128 |
} else { |
19535 | 1129 |
__FAIL__(@symbol(BadArgumentVector)) |
10440 | 1130 |
} |
1131 |
if (argTypeSymbols == nil) { |
|
19535 | 1132 |
__numArgsWanted = 0; |
10440 | 1133 |
} else if (__isArray(argTypeSymbols)) { |
19535 | 1134 |
__numArgsWanted = __arraySize(argTypeSymbols); |
10440 | 1135 |
} else { |
19535 | 1136 |
__FAIL__(@symbol(BadArgumentTypeVector)) |
10440 | 1137 |
} |
1138 |
||
1139 |
if (__numArgs != __numArgsWanted) { |
|
19535 | 1140 |
__FAIL__(@symbol(ArgumentCountMismatch)) |
9342 | 1141 |
} |
1142 |
if (__numArgs > MAX_ARGS) { |
|
19535 | 1143 |
__FAIL__(@symbol(TooManyArguments)) |
9342 | 1144 |
} |
1145 |
||
1146 |
/* |
|
19501 | 1147 |
* validate the return type and map it to an ffi_type |
9342 | 1148 |
*/ |
1149 |
__returnValuePointer = &__returnValue; |
|
9479 | 1150 |
|
9483 | 1151 |
if (returnTypeSymbol == @symbol(voidPointer)) { |
19535 | 1152 |
returnTypeSymbol = @symbol(handle); |
19501 | 1153 |
} else if (returnTypeSymbol == @symbol(hresult)) { |
19535 | 1154 |
returnTypeSymbol = @symbol(uint32); |
9483 | 1155 |
} |
9479 | 1156 |
|
9342 | 1157 |
if (returnTypeSymbol == @symbol(int)) { |
19931 | 1158 |
__returnType = TYPE_SINT; |
9342 | 1159 |
} else if (returnTypeSymbol == @symbol(uint)) { |
19931 | 1160 |
__returnType = TYPE_UINT; |
9479 | 1161 |
} else if (returnTypeSymbol == @symbol(uint8)) { |
19931 | 1162 |
__returnType = TYPE_UINT8; |
9479 | 1163 |
} else if (returnTypeSymbol == @symbol(uint16)) { |
19931 | 1164 |
__returnType = TYPE_UINT16; |
9479 | 1165 |
} else if (returnTypeSymbol == @symbol(uint32)) { |
19931 | 1166 |
__returnType = TYPE_UINT32; |
9479 | 1167 |
} else if (returnTypeSymbol == @symbol(uint64)) { |
19931 | 1168 |
__returnType = TYPE_UINT64; |
9479 | 1169 |
|
1170 |
} else if (returnTypeSymbol == @symbol(sint)) { |
|
19931 | 1171 |
__returnType = TYPE_SINT; |
9479 | 1172 |
} else if (returnTypeSymbol == @symbol(sint8)) { |
19931 | 1173 |
__returnType = TYPE_SINT8; |
9479 | 1174 |
} else if (returnTypeSymbol == @symbol(sint16)) { |
19931 | 1175 |
__returnType = TYPE_SINT16; |
9479 | 1176 |
} else if (returnTypeSymbol == @symbol(sint32)) { |
19931 | 1177 |
__returnType = TYPE_SINT32; |
9479 | 1178 |
} else if (returnTypeSymbol == @symbol(sint64)) { |
19931 | 1179 |
__returnType = TYPE_SINT64; |
9479 | 1180 |
|
9342 | 1181 |
} else if (returnTypeSymbol == @symbol(long)) { |
19535 | 1182 |
if (sizeof(long) == 4) { |
1183 |
returnTypeSymbol = @symbol(sint32); |
|
19931 | 1184 |
__returnType = TYPE_SINT32; |
19535 | 1185 |
} else if (sizeof(long) == 8) { |
1186 |
returnTypeSymbol = @symbol(sint64); |
|
19931 | 1187 |
__returnType = TYPE_SINT64; |
19535 | 1188 |
} else { |
1189 |
__FAIL__(@symbol(UnknownReturnType)) |
|
1190 |
} |
|
9479 | 1191 |
|
9342 | 1192 |
} else if (returnTypeSymbol == @symbol(ulong)) { |
19535 | 1193 |
if (sizeof(long) == 4) { |
1194 |
returnTypeSymbol = @symbol(uint32); |
|
19931 | 1195 |
__returnType = TYPE_UINT32; |
19535 | 1196 |
}else if (sizeof(long) == 8) { |
1197 |
returnTypeSymbol = @symbol(uint64); |
|
19931 | 1198 |
__returnType = TYPE_UINT64; |
19535 | 1199 |
} else { |
1200 |
__FAIL__(@symbol(UnknownReturnType)) |
|
1201 |
} |
|
9479 | 1202 |
|
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
1203 |
} else if (returnTypeSymbol == @symbol(bool)) { |
19931 | 1204 |
__returnType = TYPE_UINT; |
9479 | 1205 |
|
9342 | 1206 |
} else if (returnTypeSymbol == @symbol(float)) { |
19931 | 1207 |
__returnType = TYPE_FLOAT; |
9342 | 1208 |
} else if (returnTypeSymbol == @symbol(double)) { |
19931 | 1209 |
__returnType = TYPE_DOUBLE; |
9479 | 1210 |
|
9342 | 1211 |
} else if (returnTypeSymbol == @symbol(void)) { |
19931 | 1212 |
__returnType = TYPE_VOID; |
19535 | 1213 |
__returnValuePointer = NULL; |
11586 | 1214 |
} else if ((returnTypeSymbol == @symbol(pointer)) |
19535 | 1215 |
|| (returnTypeSymbol == @symbol(handle)) |
1216 |
|| (returnTypeSymbol == @symbol(charPointer)) |
|
1217 |
|| (returnTypeSymbol == @symbol(bytePointer)) |
|
1218 |
|| (returnTypeSymbol == @symbol(floatPointer)) |
|
1219 |
|| (returnTypeSymbol == @symbol(doublePointer)) |
|
1220 |
|| (returnTypeSymbol == @symbol(intPointer)) |
|
1221 |
|| (returnTypeSymbol == @symbol(shortPointer)) |
|
1222 |
|| (returnTypeSymbol == @symbol(wcharPointer))) { |
|
19931 | 1223 |
__returnType = TYPE_POINTER; |
9342 | 1224 |
} else { |
19535 | 1225 |
if (__isSymbol(returnTypeSymbol) |
1226 |
&& ((returnValueClass = __GLOBAL_GET(returnTypeSymbol)) != nil)) { |
|
1227 |
if (! __isBehaviorLike(returnValueClass)) { |
|
1228 |
__FAIL__(@symbol(NonBehaviorReturnType)) |
|
1229 |
} |
|
1230 |
if (! __qIsSubclassOfExternalAddress(returnValueClass)) { |
|
1231 |
__FAIL__(@symbol(NonExternalAddressReturnType)) |
|
1232 |
} |
|
19931 | 1233 |
__returnType = TYPE_POINTER; |
19535 | 1234 |
returnTypeSymbol = @symbol(pointer); |
1235 |
} else { |
|
1236 |
__FAIL__(@symbol(UnknownReturnType)) |
|
1237 |
} |
|
9342 | 1238 |
} |
1239 |
||
1240 |
/* |
|
1241 |
* validate the c++ object |
|
1242 |
*/ |
|
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
1243 |
if (aReceiverOrNil != nil) { |
19535 | 1244 |
struct cPlusPlusInstance { |
1245 |
void **vTable; |
|
1246 |
}; |
|
1247 |
struct cPlusPlusInstance *inst; |
|
9342 | 1248 |
|
19535 | 1249 |
if (__isExternalAddressLike(aReceiverOrNil)) { |
1250 |
inst = (void *)(__externalAddressVal(aReceiverOrNil)); |
|
1251 |
} else if (__isExternalBytesLike(aReceiverOrNil)) { |
|
1252 |
inst = (void *)(__externalBytesVal(aReceiverOrNil)); |
|
1253 |
} else { |
|
1254 |
__FAIL__(@symbol(InvalidInstance)) |
|
1255 |
} |
|
1256 |
__argValues[0].pointerVal = inst; |
|
1257 |
__argValuePointersIncludingThis[0] = &(__argValues[0]); |
|
19931 | 1258 |
__argTypes[0] = TYPE_POINTER; |
9342 | 1259 |
|
19535 | 1260 |
__argValuePointers = &__argValuePointersIncludingThis[1]; |
1261 |
__argTypes = &__argTypesIncludingThis[1]; |
|
1262 |
__argValues = &__argValuesIncludingThis[1]; |
|
1263 |
__numArgsIncludingThis = __numArgs + 1; |
|
9347 | 1264 |
|
19535 | 1265 |
if (virtual == true) { |
1266 |
if (! __isSmallInteger(vtOffset)) { |
|
1267 |
__FAIL__(@symbol(InvalidVTableIndex)) |
|
1268 |
} |
|
1269 |
codeAddress = inst->vTable[__intVal(vtOffset)]; |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1270 |
DEBUGCODE_IF( @global(Verbose), { |
19931 | 1271 |
printf("virtual %"_ld_" codeAddress: %"_lx_"\n", (INT)(__intVal(vtOffset)), (INT)codeAddress); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1272 |
}) |
19535 | 1273 |
} |
9342 | 1274 |
} else { |
19535 | 1275 |
__numArgsIncludingThis = __numArgs; |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1276 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1277 |
printf("codeAddress: %"_lx_"\n", (INT)codeAddress); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1278 |
}) |
9342 | 1279 |
} |
1280 |
||
1281 |
/* |
|
19501 | 1282 |
* validate all arg types, map each to an ffi_type, and setup arg-buffers |
9342 | 1283 |
*/ |
1284 |
for (i=0; i<__numArgs; i++) { |
|
19535 | 1285 |
void *argValuePtr; |
1286 |
OBJ typeSymbol; |
|
1287 |
OBJ arg; |
|
9342 | 1288 |
|
19535 | 1289 |
failureInfo = __mkSmallInteger(i+1); /* in case there is one */ |
9465 | 1290 |
|
19535 | 1291 |
typeSymbol = __ArrayInstPtr(argTypeSymbols)->a_element[i]; |
1292 |
arg = __ArrayInstPtr(argumentsOrNil)->a_element[i]; |
|
9342 | 1293 |
|
19535 | 1294 |
if (typeSymbol == @symbol(handle)) { |
1295 |
typeSymbol = @symbol(pointer); |
|
1296 |
} else if (typeSymbol == @symbol(voidPointer)) { |
|
1297 |
typeSymbol = @symbol(pointer); |
|
1298 |
} else if (returnTypeSymbol == @symbol(hresult)) { |
|
1299 |
typeSymbol = @symbol(uint32); |
|
1300 |
} |
|
9479 | 1301 |
|
19535 | 1302 |
if (typeSymbol == @symbol(long)) { |
1303 |
if (sizeof(long) == sizeof(int)) { |
|
1304 |
typeSymbol = @symbol(sint); |
|
1305 |
} else { |
|
1306 |
if (sizeof(long) == 4) { |
|
1307 |
typeSymbol = @symbol(sint32); |
|
1308 |
} else if (sizeof(long) == 8) { |
|
1309 |
typeSymbol = @symbol(sint64); |
|
1310 |
} |
|
1311 |
} |
|
1312 |
} |
|
1313 |
if (typeSymbol == @symbol(ulong)) { |
|
1314 |
if (sizeof(unsigned long) == sizeof(unsigned int)) { |
|
1315 |
typeSymbol = @symbol(uint); |
|
1316 |
} else { |
|
1317 |
if (sizeof(long) == 4) { |
|
1318 |
typeSymbol = @symbol(uint32); |
|
1319 |
} else if (sizeof(long) == 8) { |
|
1320 |
typeSymbol = @symbol(uint64); |
|
1321 |
} |
|
1322 |
} |
|
1323 |
} |
|
9342 | 1324 |
|
19535 | 1325 |
if (typeSymbol == @symbol(int) || typeSymbol == @symbol(sint)) { |
19931 | 1326 |
thisType = TYPE_SINT; |
19535 | 1327 |
if (__isSmallInteger(arg)) { |
1328 |
__argValues[i].iVal = __intVal(arg); |
|
1329 |
} else { |
|
1330 |
__argValues[i].iVal = __signedLongIntVal(arg); |
|
1331 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1332 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1333 |
printf("invalidArgument: arg%d sint value out of range [%d]\n", i+1, __LINE__); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1334 |
}) |
19535 | 1335 |
__FAIL__(@symbol(InvalidArgument)) |
1336 |
} |
|
1337 |
} |
|
1338 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1339 |
|
19535 | 1340 |
} else if (typeSymbol == @symbol(uint)) { |
19931 | 1341 |
thisType = TYPE_UINT; |
9342 | 1342 |
|
19535 | 1343 |
if (__isSmallInteger(arg)) { |
1344 |
__argValues[i].iVal = __intVal(arg); |
|
1345 |
} else { |
|
1346 |
__argValues[i].iVal = __unsignedLongIntVal(arg); |
|
1347 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1348 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1349 |
printf("invalidArgument: arg%d uint value out of range [%d]\n", i+1, __LINE__); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1350 |
}) |
19535 | 1351 |
__FAIL__(@symbol(InvalidArgument)) |
1352 |
} |
|
1353 |
} |
|
1354 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1355 |
|
19535 | 1356 |
} else if (typeSymbol == @symbol(uint8)) { |
19931 | 1357 |
thisType = TYPE_UINT8; |
19535 | 1358 |
if (! __isSmallInteger(arg)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1359 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1360 |
printf("invalidArgument: arg%d uint8 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1361 |
}) |
19535 | 1362 |
__FAIL__(@symbol(InvalidArgument)) |
1363 |
} |
|
1364 |
__argValues[i].iVal = __intVal(arg); |
|
1365 |
if (((unsigned)(__argValues[i].iVal)) > 0xFF) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1366 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1367 |
printf("invalidArgument: arg%d uint8 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1368 |
}) |
19535 | 1369 |
__FAIL__(@symbol(InvalidArgument)) |
1370 |
} |
|
1371 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1372 |
|
19535 | 1373 |
} else if (typeSymbol == @symbol(sint8)) { |
19931 | 1374 |
thisType = TYPE_SINT8; |
19535 | 1375 |
if (! __isSmallInteger(arg)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1376 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1377 |
printf("invalidArgument: arg%d sint8 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1378 |
}) |
19535 | 1379 |
__FAIL__(@symbol(InvalidArgument)) |
1380 |
} |
|
1381 |
__argValues[i].iVal = __intVal(arg); |
|
1382 |
if (((__argValues[i].iVal) < -0x80) || ((__argValues[i].iVal) > 0x7F)) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1383 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1384 |
printf("invalidArgument: arg%d sint8 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1385 |
}) |
19535 | 1386 |
__FAIL__(@symbol(InvalidArgument)) |
1387 |
} |
|
1388 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1389 |
|
19535 | 1390 |
} else if (typeSymbol == @symbol(uint16)) { |
19931 | 1391 |
thisType = TYPE_UINT16; |
19535 | 1392 |
if (! __isSmallInteger(arg)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1393 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1394 |
printf("invalidArgument: arg%d uint16 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1395 |
}) |
19535 | 1396 |
__FAIL__(@symbol(InvalidArgument)) |
1397 |
} |
|
1398 |
__argValues[i].iVal = __intVal(arg); |
|
1399 |
if (((unsigned)(__argValues[i].iVal)) > 0xFFFF) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1400 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1401 |
printf("invalidArgument: arg%d uint16 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1402 |
}) |
19535 | 1403 |
__FAIL__(@symbol(InvalidArgument)) |
1404 |
} |
|
1405 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1406 |
|
19535 | 1407 |
} else if (typeSymbol == @symbol(sint16)) { |
19931 | 1408 |
thisType = TYPE_SINT16; |
19535 | 1409 |
if (! __isSmallInteger(arg)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1410 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1411 |
printf("invalidArgument: arg%d sint16 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1412 |
}) |
19535 | 1413 |
__FAIL__(@symbol(InvalidArgument)) |
1414 |
} |
|
1415 |
__argValues[i].iVal = __intVal(arg); |
|
1416 |
if (((__argValues[i].iVal) < -0x8000) || ((__argValues[i].iVal) > 0x7FFF)) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1417 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1418 |
printf("invalidArgument: arg%d sint16 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1419 |
}) |
19535 | 1420 |
__FAIL__(@symbol(InvalidArgument)) |
1421 |
} |
|
1422 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1423 |
|
19535 | 1424 |
} else if (typeSymbol == @symbol(uint32)) { |
19931 | 1425 |
thisType = TYPE_UINT32; |
19535 | 1426 |
if (__isSmallInteger(arg)) { |
1427 |
__argValues[i].iVal = __intVal(arg); |
|
1428 |
} else { |
|
1429 |
__argValues[i].iVal = __unsignedLongIntVal(arg); |
|
1430 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1431 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1432 |
printf("invalidArgument: arg%d uint32 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1433 |
}) |
19535 | 1434 |
__FAIL__(@symbol(InvalidArgument)) |
1435 |
} |
|
1436 |
} |
|
19334 | 1437 |
# if __POINTER_SIZE__ == 8 |
19535 | 1438 |
if ((__argValues[i].iVal) < 0) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1439 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1440 |
printf("invalidArgument: arg%d uint32 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1441 |
}) |
19535 | 1442 |
__FAIL__(@symbol(InvalidArgument)) |
1443 |
} |
|
19334 | 1444 |
# endif |
19535 | 1445 |
argValuePtr = &(__argValues[i].iVal); |
19334 | 1446 |
|
19535 | 1447 |
} else if (typeSymbol == @symbol(sint32)) { |
19931 | 1448 |
thisType = TYPE_SINT32; |
19535 | 1449 |
if (__isSmallInteger(arg)) { |
1450 |
__argValues[i].iVal = __intVal(arg); |
|
1451 |
} else { |
|
1452 |
__argValues[i].iVal = __signedLongIntVal(arg); |
|
1453 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1454 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1455 |
printf("invalidArgument: arg%d sint32 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1456 |
}) |
19535 | 1457 |
__FAIL__(@symbol(InvalidArgument)) |
1458 |
} |
|
1459 |
} |
|
19334 | 1460 |
# if __POINTER_SIZE__ == 8 |
19535 | 1461 |
if (((__argValues[i].iVal) < -0x80000000LL) || ((__argValues[i].iVal) > 0x7FFFFFFFLL)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1462 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1463 |
printf("invalidArgument: arg%d sint32 value (%"_lx_") out of range [%d]\n", i+1, __argValues[i].iVal, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1464 |
}) |
19535 | 1465 |
__FAIL__(@symbol(InvalidArgument)) |
1466 |
} |
|
19334 | 1467 |
# endif |
19535 | 1468 |
argValuePtr = &(__argValues[i].iVal); |
19334 | 1469 |
|
19535 | 1470 |
} else if (typeSymbol == @symbol(uint64)) { |
19931 | 1471 |
thisType = TYPE_UINT64; |
19535 | 1472 |
if (__isSmallInteger(arg)) { |
1473 |
__argValues[i].iVal = __intVal(arg); |
|
1474 |
} else { |
|
1475 |
__argValues[i].iVal = __unsignedLongIntVal(arg); |
|
1476 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1477 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1478 |
printf("invalidArgument: arg%d uint64 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1479 |
}) |
19535 | 1480 |
__FAIL__(@symbol(InvalidArgument)) |
1481 |
} |
|
1482 |
} |
|
1483 |
argValuePtr = &(__argValues[i].iVal); |
|
19334 | 1484 |
|
19535 | 1485 |
} else if (typeSymbol == @symbol(sint64)) { |
19931 | 1486 |
thisType = TYPE_SINT64; |
19535 | 1487 |
if (__isSmallInteger(arg)) { |
1488 |
__argValues[i].iVal = __intVal(arg); |
|
1489 |
} else { |
|
1490 |
__argValues[i].iVal = __signedLongIntVal(arg); |
|
1491 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1492 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1493 |
printf("invalidArgument: arg%d sint64 value out of range [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1494 |
}) |
19535 | 1495 |
__FAIL__(@symbol(InvalidArgument)) |
1496 |
} |
|
1497 |
} |
|
1498 |
argValuePtr = &(__argValues[i].iVal); |
|
9479 | 1499 |
|
19535 | 1500 |
} else if (typeSymbol == @symbol(float)) { |
19931 | 1501 |
thisType = TYPE_FLOAT; |
19535 | 1502 |
if (__isSmallInteger(arg)) { |
1503 |
__argValues[i].fVal = (float)(__intVal(arg)); |
|
1504 |
} else if (__isFloat(arg)) { |
|
1505 |
__argValues[i].fVal = (float)(__floatVal(arg)); |
|
1506 |
} else if (__isShortFloat(arg)) { |
|
1507 |
__argValues[i].fVal = (float)(__shortFloatVal(arg)); |
|
1508 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1509 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1510 |
printf("invalidArgument: arg%d non float value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1511 |
}) |
19535 | 1512 |
__FAIL__(@symbol(InvalidArgument)) |
1513 |
} |
|
1514 |
argValuePtr = &(__argValues[i].fVal); |
|
1515 |
} else if (typeSymbol == @symbol(double)) { |
|
19931 | 1516 |
thisType = TYPE_DOUBLE; |
19535 | 1517 |
if (__isSmallInteger(arg)) { |
1518 |
__argValues[i].dVal = (double)(__intVal(arg)); |
|
1519 |
} else if (__isFloat(arg)) { |
|
1520 |
__argValues[i].dVal = (double)(__floatVal(arg)); |
|
1521 |
} else if (__isShortFloat(arg)) { |
|
1522 |
__argValues[i].dVal = (double)(__shortFloatVal(arg)); |
|
1523 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1524 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1525 |
printf("invalidArgument: arg%d non double value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1526 |
}) |
19535 | 1527 |
__FAIL__(@symbol(InvalidArgument)) |
1528 |
} |
|
1529 |
argValuePtr = &(__argValues[i].dVal); |
|
9479 | 1530 |
|
19535 | 1531 |
} else if (typeSymbol == @symbol(void)) { |
19931 | 1532 |
thisType = TYPE_VOID; |
19535 | 1533 |
argValuePtr = &null; |
9479 | 1534 |
|
19535 | 1535 |
} else if (typeSymbol == @symbol(charPointer)) { |
19931 | 1536 |
thisType = TYPE_POINTER; |
19535 | 1537 |
if (__isStringLike(arg)) { |
1538 |
if (async == true) goto badArgForAsyncCall; |
|
1539 |
__argValues[i].pointerVal = (void *)(__stringVal(arg)); |
|
1540 |
} else if (__isBytes(arg)) { |
|
1541 |
if (async == true) goto badArgForAsyncCall; |
|
1542 |
__argValues[i].pointerVal = (void *)(__byteArrayVal(arg)); |
|
1543 |
} else if (__isExternalAddressLike(arg)) { |
|
1544 |
__argValues[i].pointerVal = (void *)(__externalAddressVal(arg)); |
|
1545 |
} else if (__isExternalBytesLike(arg)) { |
|
1546 |
__argValues[i].pointerVal = (void *)(__externalBytesVal(arg)); |
|
1547 |
} else { |
|
1548 |
if (arg == nil) { |
|
1549 |
__argValues[i].pointerVal = (void *)0; |
|
1550 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1551 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1552 |
printf("invalidArgument: arg%d non charPointer value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1553 |
}) |
19535 | 1554 |
__FAIL__(@symbol(InvalidArgument)) |
1555 |
} |
|
1556 |
} |
|
1557 |
argValuePtr = &(__argValues[i].pointerVal);; |
|
10603 | 1558 |
|
19535 | 1559 |
} else if (typeSymbol == @symbol(wcharPointer)) { |
19931 | 1560 |
thisType = TYPE_POINTER; |
19535 | 1561 |
if (__isUnicode16String(arg)) { |
1562 |
if (async == true) goto badArgForAsyncCall; |
|
1563 |
__argValues[i].pointerVal = (void *)(__unicode16StringVal(arg)); |
|
1564 |
} else if (__isBytes(arg)) { |
|
1565 |
if (async == true) goto badArgForAsyncCall; |
|
1566 |
__argValues[i].pointerVal = (void *)(__byteArrayVal(arg)); |
|
1567 |
} else if (__isExternalAddressLike(arg)) { |
|
1568 |
__argValues[i].pointerVal = (void *)(__externalAddressVal(arg)); |
|
1569 |
} else if (__isExternalBytesLike(arg)) { |
|
1570 |
__argValues[i].pointerVal = (void *)(__externalBytesVal(arg)); |
|
1571 |
} else { |
|
1572 |
if (arg == nil) { |
|
1573 |
__argValues[i].pointerVal = (void *)0; |
|
1574 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1575 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1576 |
printf("invalidArgument: arg%d non wcharPointer value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1577 |
}) |
19535 | 1578 |
__FAIL__(@symbol(InvalidArgument)) |
1579 |
} |
|
1580 |
} |
|
1581 |
argValuePtr = &(__argValues[i].pointerVal);; |
|
12656 | 1582 |
|
19535 | 1583 |
} else if (typeSymbol == @symbol(floatPointer)) { |
19931 | 1584 |
thisType = TYPE_POINTER; |
19535 | 1585 |
if (__isBytes(arg)) { |
1586 |
if (async == true) goto badArgForAsyncCall; |
|
1587 |
__argValues[i].pointerVal = (void *)(__byteArrayVal(arg)); |
|
1588 |
} else if (__isExternalAddressLike(arg)) { |
|
1589 |
__argValues[i].pointerVal = (void *)(__externalAddressVal(arg)); |
|
1590 |
} else if (__isExternalBytesLike(arg)) { |
|
1591 |
__argValues[i].pointerVal = (void *)(__externalBytesVal(arg)); |
|
1592 |
} else if (__isFloats(arg)) { |
|
1593 |
char *p = (char *)(__FloatArrayInstPtr(arg)->f_element); |
|
1594 |
int nInstBytes; |
|
1595 |
OBJ cls; |
|
10603 | 1596 |
|
19535 | 1597 |
if (async == true) goto badArgForAsyncCall; |
1598 |
cls = __qClass(arg); |
|
1599 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
1600 |
p = p + nInstBytes; |
|
1601 |
__argValues[i].pointerVal = p; |
|
1602 |
} else { |
|
1603 |
if (arg == nil) { |
|
1604 |
__argValues[i].pointerVal = (void *)0; |
|
1605 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1606 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1607 |
printf("invalidArgument: arg%d non floatPointer value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1608 |
}) |
19535 | 1609 |
__FAIL__(@symbol(InvalidArgument)) |
1610 |
} |
|
1611 |
} |
|
1612 |
argValuePtr = &(__argValues[i].pointerVal);; |
|
10603 | 1613 |
|
19535 | 1614 |
} else if (typeSymbol == @symbol(doublePointer)) { |
19931 | 1615 |
thisType = TYPE_POINTER; |
19535 | 1616 |
if (__isBytes(arg)) { |
1617 |
if (async == true) goto badArgForAsyncCall; |
|
1618 |
__argValues[i].pointerVal = (void *)(__byteArrayVal(arg)); |
|
1619 |
} else if (__isExternalAddressLike(arg)) { |
|
1620 |
__argValues[i].pointerVal = (void *)(__externalAddressVal(arg)); |
|
1621 |
} else if (__isExternalBytesLike(arg)) { |
|
1622 |
__argValues[i].pointerVal = (void *)(__externalBytesVal(arg)); |
|
1623 |
} else if (__isDoubles(arg)) { |
|
1624 |
char *p = (char *)(__DoubleArrayInstPtr(arg)->d_element); |
|
1625 |
int nInstBytes; |
|
1626 |
OBJ cls; |
|
10603 | 1627 |
|
19535 | 1628 |
if (async == true) goto badArgForAsyncCall; |
1629 |
cls = __qClass(arg); |
|
1630 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
1631 |
p = p + nInstBytes; |
|
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1632 |
# ifdef __NEED_DOUBLE_ALIGN |
19535 | 1633 |
if ((INT)(__DoubleArrayInstPtr(arg)->d_element) & (__DOUBLE_ALIGN-1)) { |
1634 |
int delta = __DOUBLE_ALIGN - ((INT)p & (__DOUBLE_ALIGN-1)); |
|
10603 | 1635 |
|
19535 | 1636 |
p += delta; |
1637 |
} |
|
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
1638 |
# endif |
19535 | 1639 |
__argValues[i].pointerVal = p; |
1640 |
} else { |
|
1641 |
if (arg == nil) { |
|
1642 |
__argValues[i].pointerVal = (void *)0; |
|
1643 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1644 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1645 |
printf("invalidArgument: arg%d non doublePointer value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1646 |
}) |
19535 | 1647 |
__FAIL__(@symbol(InvalidArgument)) |
1648 |
} |
|
1649 |
} |
|
1650 |
argValuePtr = &(__argValues[i].pointerVal);; |
|
9479 | 1651 |
|
19535 | 1652 |
} else if (typeSymbol == @symbol(pointer)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1653 |
commonPointerTypeArg: ; |
19931 | 1654 |
thisType = TYPE_POINTER; |
19535 | 1655 |
if (arg == nil) { |
1656 |
__argValues[i].pointerVal = NULL; |
|
1657 |
} else if (__isExternalAddressLike(arg)) { |
|
1658 |
__argValues[i].pointerVal = (void *)(__externalAddressVal(arg)); |
|
1659 |
} else if (__isExternalBytesLike(arg)) { |
|
1660 |
__argValues[i].pointerVal = (void *)(__externalBytesVal(arg)); |
|
1661 |
} else if (__isByteArrayLike(arg)) { |
|
1662 |
if (async == true) goto badArgForAsyncCall; |
|
1663 |
__argValues[i].pointerVal = (void *)(__byteArrayVal(arg)); |
|
1664 |
} else if (__isWordArray(arg) || __isSignedWordArray(arg) |
|
1665 |
|| __isIntegerArray(arg) || __isSignedIntegerArray(arg)) { |
|
1666 |
if (async == true) goto badArgForAsyncCall; |
|
1667 |
__argValues[i].pointerVal = (void *)(__integerArrayVal(arg)); |
|
1668 |
} else if (__isFloatArray(arg)) { |
|
1669 |
if (async == true) goto badArgForAsyncCall; |
|
1670 |
__argValues[i].pointerVal = (void *)(__FloatArrayInstPtr(arg)->f_element); |
|
1671 |
} else if (__isDoubleArray(arg)) { |
|
1672 |
if (async == true) goto badArgForAsyncCall; |
|
1673 |
__argValues[i].pointerVal = (void *)(__DoubleArrayInstPtr(arg)->d_element); |
|
1674 |
} else if (__isStringLike(arg)) { |
|
1675 |
if (async == true) { |
|
9435 | 1676 |
badArgForAsyncCall: ; |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1677 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1678 |
printf("invalidArgument: arg%d not allowed for async call [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1679 |
}) |
19535 | 1680 |
__FAIL__(@symbol(BadArgForAsyncCall)) |
1681 |
} |
|
1682 |
__argValues[i].pointerVal = (void *)(__stringVal(arg)); |
|
1683 |
} else if (__isBytes(arg) || __isWords(arg) || __isLongs(arg)) { |
|
1684 |
char *p = (char *)(__byteArrayVal(arg)); |
|
1685 |
int nInstBytes; |
|
1686 |
OBJ cls; |
|
9483 | 1687 |
|
19535 | 1688 |
if (async == true) goto badArgForAsyncCall; |
1689 |
cls = __qClass(arg); |
|
1690 |
nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
|
1691 |
__argValues[i].pointerVal = p + nInstBytes; |
|
1692 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1693 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1694 |
printf("invalidArgument: arg%d non pointer value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1695 |
}) |
19535 | 1696 |
__FAIL__(@symbol(InvalidArgument)) |
1697 |
} |
|
1698 |
argValuePtr = &(__argValues[i].pointerVal);; |
|
9479 | 1699 |
|
19535 | 1700 |
} else if (typeSymbol == @symbol(bool)) { |
19931 | 1701 |
thisType = TYPE_UINT; |
9342 | 1702 |
|
19535 | 1703 |
if (arg == true) { |
1704 |
__argValues[i].iVal = 1; |
|
1705 |
} else if (arg == false) { |
|
1706 |
__argValues[i].iVal = 0; |
|
1707 |
} else if (__isSmallInteger(arg)) { |
|
1708 |
__argValues[i].iVal = __intVal(arg); |
|
1709 |
} else { |
|
1710 |
__argValues[i].iVal = __unsignedLongIntVal(arg); |
|
1711 |
if (__argValues[i].iVal == 0) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1712 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1713 |
printf("invalidArgument: arg%d non bool value [%d]\n", i+1, __LINE__); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1714 |
}) |
19535 | 1715 |
__FAIL__(@symbol(InvalidArgument)) |
1716 |
} |
|
1717 |
} |
|
1718 |
argValuePtr = &(__argValues[i].iVal); |
|
1719 |
} else { |
|
1720 |
if (__isSymbol(typeSymbol) |
|
1721 |
&& ((argValueClass = __GLOBAL_GET(typeSymbol)) != nil)) { |
|
1722 |
if (! __isBehaviorLike(argValueClass)) { |
|
1723 |
__FAIL__(@symbol(NonBehaviorArgumentType)) |
|
1724 |
} |
|
1725 |
if (! __qIsSubclassOfExternalAddress(argValueClass)) { |
|
1726 |
__FAIL__(@symbol(NonExternalAddressArgumentType)) |
|
1727 |
} |
|
1728 |
goto commonPointerTypeArg; /* sorry */ |
|
1729 |
} else { |
|
1730 |
__FAIL__(@symbol(UnknownArgumentType)) |
|
1731 |
} |
|
1732 |
} |
|
9342 | 1733 |
|
19535 | 1734 |
__argTypes[i] = thisType; |
1735 |
__argValuePointers[i] = argValuePtr; |
|
9483 | 1736 |
|
19932 | 1737 |
if ((thisType == TYPE_FLOAT) || (thisType == TYPE_DOUBLE)) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1738 |
__numFloatOrDoubleArgs++; |
19932 | 1739 |
} |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1740 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1741 |
printf("arg%d: %"_lx_" type:%"_lx_"\n", i+1, (INT)(__argValues[i].iVal), (INT)thisType); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1742 |
}) |
9342 | 1743 |
} |
9465 | 1744 |
failureInfo = nil; |
9342 | 1745 |
|
9465 | 1746 |
if (callTypeNumber == @global(CALLTYPE_API)) { |
20288
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1747 |
# ifdef __MINGW64__ |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1748 |
__callType = FFI_DEFAULT_ABI; |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1749 |
# else |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1750 |
# ifdef CALLTYPE_FFI_STDCALL |
19535 | 1751 |
__callType = CALLTYPE_FFI_STDCALL; |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1752 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1753 |
printf("STDCALL\n"); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1754 |
}) |
19931 | 1755 |
failureCode = @symbol(FFICallTypeNotSupported); |
1756 |
goto getOutOfHere; |
|
20288
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1757 |
# endif |
19931 | 1758 |
# endif |
9342 | 1759 |
} |
19931 | 1760 |
|
1761 |
// these calltypes are only supported on some systems; others report an error |
|
9465 | 1762 |
if (callTypeNumber == @global(CALLTYPE_V8)) { |
19931 | 1763 |
# ifdef CALLTYPE_FFI_V8 |
19535 | 1764 |
__callType = CALLTYPE_FFI_V8; |
19931 | 1765 |
# else |
1766 |
failureCode = @symbol(FFICallTypeNotSupported); |
|
1767 |
goto getOutOfHere; |
|
1768 |
# endif |
|
9342 | 1769 |
} |
19931 | 1770 |
|
9465 | 1771 |
if (callTypeNumber == @global(CALLTYPE_V9)) { |
19931 | 1772 |
# ifdef CALLTYPE_FFI_V9 |
19535 | 1773 |
__callType = CALLTYPE_FFI_V9; |
19931 | 1774 |
# else |
1775 |
failureCode = @symbol(FFICallTypeNotSupported); |
|
1776 |
goto getOutOfHere; |
|
1777 |
# endif |
|
9342 | 1778 |
} |
19931 | 1779 |
|
9465 | 1780 |
if (callTypeNumber == @global(CALLTYPE_UNIX64)) { |
19931 | 1781 |
# ifdef CALLTYPE_FFI_UNIX64 |
19535 | 1782 |
__callType = CALLTYPE_FFI_UNIX64; |
19931 | 1783 |
# else |
1784 |
failureCode = @symbol(FFICallTypeNotSupported); |
|
1785 |
goto getOutOfHere; |
|
1786 |
# endif |
|
9342 | 1787 |
} |
1788 |
||
19931 | 1789 |
# ifdef HAVE_FFI |
20288
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1790 |
# ifdef VERBOSE |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1791 |
if (@global(Verbose) == true) { |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1792 |
printf("prep: numargs=%d\n", __numArgsIncludingThis); |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1793 |
} |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1794 |
# endif |
604e46cfbf18
ffi for mingw - 64-bit machine has no API_CALL
Claus Gittinger <cg@exept.de>
parents:
19951
diff
changeset
|
1795 |
|
9342 | 1796 |
if (ffi_prep_cif(&__cif, __callType, __numArgsIncludingThis, __returnType, __argTypesIncludingThis) != FFI_OK) { |
19535 | 1797 |
__FAIL__(@symbol(FFIPrepareFailed)) |
9342 | 1798 |
} |
9463 | 1799 |
if (async == true) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1800 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1801 |
printf("async call 0x%"_lx_"\n", (INT)codeAddress); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1802 |
}) |
19931 | 1803 |
# ifdef __win32__ |
19535 | 1804 |
__STX_C_CALL4( "ffi_call", ffi_call, &__cif, codeAddress, __returnValuePointer, __argValuePointersIncludingThis); |
19931 | 1805 |
# else |
19535 | 1806 |
__BEGIN_INTERRUPTABLE__ |
1807 |
ffi_call(&__cif, codeAddress, __returnValuePointer, __argValuePointersIncludingThis); |
|
1808 |
__END_INTERRUPTABLE__ |
|
19931 | 1809 |
# endif |
9435 | 1810 |
} else { |
19535 | 1811 |
if (unlimitedStack == true) { |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1812 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1813 |
printf("UNLIMITEDSTACKCALL call 0x%"_lx_"\n", (INT)codeAddress); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1814 |
}) |
19535 | 1815 |
__UNLIMITEDSTACKCALL4__((OBJFUNC)ffi_call, (INT)(&__cif), (INT)codeAddress, (INT)__returnValuePointer, (INT)__argValuePointersIncludingThis); |
1816 |
} else { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1817 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 1818 |
printf("call 0x%"_lx_"\n", (INT)codeAddress); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1819 |
}) |
19535 | 1820 |
ffi_call(&__cif, codeAddress, __returnValuePointer, __argValuePointersIncludingThis); |
1821 |
} |
|
9435 | 1822 |
} |
19931 | 1823 |
|
1824 |
# else /* NO FFI */ |
|
1825 |
||
1826 |
// this is a fallback; simply assume that pointer and regular args |
|
1827 |
// can be passed in the same registers, and that all args are casted to the same |
|
1828 |
// (pointer-) size. |
|
1829 |
// Also, that float/doubles are passed down in regular registers, |
|
1830 |
// and the return types float and double are handled diferently from ints. |
|
1831 |
// If that is not correct for your CPU/architecture, an ifndef is required here. |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1832 |
// No longer limited to non-double args: for x86_64, sort by non-float/float args and |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1833 |
// pass down separately. |
19931 | 1834 |
|
1835 |
{ |
|
1836 |
VOIDPTRFUNC fi = (VOIDPTRFUNC)codeAddress; |
|
1837 |
DOUBLEFUNC fd = (DOUBLEFUNC)codeAddress; |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1838 |
int rI[MAX_ARGS], dI[MAX_ARGS]; |
20295 | 1839 |
int i; |
19931 | 1840 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1841 |
// sort the float/double args into a separate arglist and pass them AFTER the regular args. |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1842 |
// This is possible, because all doubles are passed in floating-pnt registers, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1843 |
// no matter where they are in the arglist. |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1844 |
int argI = 0, nonDoubleI = 0, doubleI = 0; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1845 |
|
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1846 |
for (argI=0; argI<__numArgsIncludingThis; argI++) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1847 |
# if defined(__x86_64__) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1848 |
if ((__argTypesIncludingThis[argI] == TYPE_DOUBLE) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1849 |
|| (__argTypesIncludingThis[argI] == TYPE_FLOAT)) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1850 |
dI[doubleI++] = argI; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1851 |
} else |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1852 |
# endif // __x86_64__ |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1853 |
{ |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1854 |
rI[nonDoubleI++] = argI; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1855 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1856 |
} |
20295 | 1857 |
for (i=doubleI; i<__numArgsIncludingThis; i++) dI[doubleI++] = 0; |
1858 |
for (i=nonDoubleI; i<__numArgsIncludingThis; i++) rI[nonDoubleI++] = 0; |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1859 |
|
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1860 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1861 |
printf("call %p with %d args (%d regular, %d double)\n", codeAddress, __numArgsIncludingThis, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1862 |
nonDoubleI, doubleI); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1863 |
}) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1864 |
if (doubleI == 0) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1865 |
// no double args |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1866 |
switch (__returnType) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1867 |
case TYPE_FLOAT: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1868 |
case TYPE_DOUBLE: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1869 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1870 |
printf("non-double arg; double retval\n"); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1871 |
}) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1872 |
switch (__numArgsIncludingThis) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1873 |
case 0: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1874 |
__returnValue.dVal = (*fd)(); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1875 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1876 |
case 1: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1877 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1878 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1879 |
case 2: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1880 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1881 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1882 |
case 3: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1883 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1884 |
__argValues[rI[2]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1885 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1886 |
case 4: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1887 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1888 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1889 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1890 |
case 5: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1891 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1892 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1893 |
__argValues[rI[4]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1894 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1895 |
case 6: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1896 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1897 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1898 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1899 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1900 |
case 7: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1901 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1902 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1903 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1904 |
__argValues[rI[6]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1905 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1906 |
case 8: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1907 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1908 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1909 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1910 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1911 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1912 |
case 9: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1913 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1914 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1915 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1916 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1917 |
__argValues[rI[8]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1918 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1919 |
case 10: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1920 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1921 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1922 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1923 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1924 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1925 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1926 |
case 11: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1927 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1928 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1929 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1930 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1931 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1932 |
__argValues[rI[10]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1933 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1934 |
case 12: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1935 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1936 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1937 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1938 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1939 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1940 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1941 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1942 |
case 13: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1943 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1944 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1945 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1946 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1947 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1948 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1949 |
__argValues[rI[12]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1950 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1951 |
case 14: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1952 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1953 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1954 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1955 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1956 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1957 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1958 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1959 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1960 |
case 15: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1961 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1962 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1963 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1964 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1965 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1966 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1967 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1968 |
__argValues[rI[14]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1969 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1970 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1971 |
failureCode = @symbol(TooManyArguments); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1972 |
goto getOutOfHere; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1973 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1974 |
break; |
19931 | 1975 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1976 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1977 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1978 |
printf("non-double arg; non-double retval\n"); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1979 |
}) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1980 |
switch (__numArgsIncludingThis) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1981 |
case 0: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1982 |
__returnValue.pointerVal = (*fi)(); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1983 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1984 |
case 1: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1985 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1986 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1987 |
case 2: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1988 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1989 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1990 |
case 3: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1991 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1992 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1993 |
case 4: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1994 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1995 |
__argValues[rI[3]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1996 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1997 |
case 5: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1998 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
1999 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2000 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2001 |
case 6: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2002 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2003 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2004 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2005 |
case 7: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2006 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2007 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2008 |
__argValues[rI[6]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2009 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2010 |
case 8: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2011 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2012 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2013 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2014 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2015 |
case 9: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2016 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2017 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2018 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2019 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2020 |
case 10: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2021 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2022 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2023 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2024 |
__argValues[rI[9]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2025 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2026 |
case 11: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2027 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2028 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2029 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2030 |
__argValues[rI[9]].pointerVal, __argValues[rI[10]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2031 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2032 |
case 12: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2033 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2034 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2035 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2036 |
__argValues[rI[9]].pointerVal, __argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2037 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2038 |
case 13: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2039 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2040 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2041 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2042 |
__argValues[rI[9]].pointerVal, __argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2043 |
__argValues[rI[12]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2044 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2045 |
case 14: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2046 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2047 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2048 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2049 |
__argValues[rI[9]].pointerVal, __argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2050 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2051 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2052 |
case 15: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2053 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, __argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2054 |
__argValues[rI[3]].pointerVal, __argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2055 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, __argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2056 |
__argValues[rI[9]].pointerVal, __argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2057 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, __argValues[rI[14]].pointerVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2058 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2059 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2060 |
failureCode = @symbol(TooManyArguments); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2061 |
goto getOutOfHere; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2062 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2063 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2064 |
} else { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2065 |
// has double args |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2066 |
switch (__returnType) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2067 |
case TYPE_FLOAT: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2068 |
case TYPE_DOUBLE: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2069 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2070 |
printf("double arg(s); double retval\n"); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2071 |
}) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2072 |
switch (__numArgsIncludingThis) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2073 |
case 0: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2074 |
__returnValue.dVal = (*fd)( ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2075 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2076 |
case 1: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2077 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2078 |
__argValues[dI[0]].dVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2079 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2080 |
case 2: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2081 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2082 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2083 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2084 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2085 |
case 3: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2086 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2087 |
__argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2088 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2089 |
__argValues[dI[2]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2090 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2091 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2092 |
case 4: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2093 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2094 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2095 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2096 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2097 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2098 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2099 |
case 5: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2100 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2101 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2102 |
__argValues[rI[4]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2103 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2104 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2105 |
__argValues[dI[4]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2106 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2107 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2108 |
case 6: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2109 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2110 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2111 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2112 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2113 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2114 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2115 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2116 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2117 |
case 7: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2118 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2119 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2120 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2121 |
__argValues[rI[6]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2122 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2123 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2124 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2125 |
__argValues[dI[6]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2126 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2127 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2128 |
case 8: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2129 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2130 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2131 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2132 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2133 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2134 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2135 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2136 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2137 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2138 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2139 |
case 9: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2140 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2141 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2142 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2143 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2144 |
__argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2145 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2146 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2147 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2148 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2149 |
__argValues[dI[8]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2150 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2151 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2152 |
case 10: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2153 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2154 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2155 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2156 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2157 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2158 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2159 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2160 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2161 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2162 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2163 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2164 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2165 |
case 11: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2166 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2167 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2168 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2169 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2170 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2171 |
__argValues[rI[10]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2172 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2173 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2174 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2175 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2176 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2177 |
__argValues[dI[10]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2178 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2179 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2180 |
case 12: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2181 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2182 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2183 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2184 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2185 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2186 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2187 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2188 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2189 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2190 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2191 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2192 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2193 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2194 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2195 |
case 13: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2196 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2197 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2198 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2199 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2200 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2201 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2202 |
__argValues[rI[12]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2203 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2204 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2205 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2206 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2207 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2208 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2209 |
__argValues[dI[12]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2210 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2211 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2212 |
case 14: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2213 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2214 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2215 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2216 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2217 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2218 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2219 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2220 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2221 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2222 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2223 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2224 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2225 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2226 |
__argValues[dI[12]].dVal, __argValues[dI[13]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2227 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2228 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2229 |
case 15: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2230 |
__returnValue.dVal = (*fd)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2231 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2232 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2233 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2234 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2235 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2236 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2237 |
__argValues[rI[14]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2238 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2239 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2240 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2241 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2242 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2243 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2244 |
__argValues[dI[12]].dVal, __argValues[dI[13]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2245 |
__argValues[dI[14]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2246 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2247 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2248 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2249 |
failureCode = @symbol(TooManyArguments); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2250 |
goto getOutOfHere; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2251 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2252 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2253 |
|
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2254 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2255 |
DEBUGCODE_IF( @global(Verbose), { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2256 |
printf("double arg(s); non-double retval\n"); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2257 |
}) |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2258 |
switch (__numArgsIncludingThis) { |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2259 |
case 0: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2260 |
__returnValue.pointerVal = (*fi)( ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2261 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2262 |
case 1: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2263 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2264 |
__argValues[dI[0]].dVal ); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2265 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2266 |
case 2: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2267 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2268 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2269 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2270 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2271 |
case 3: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2272 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2273 |
__argValues[rI[2]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2274 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2275 |
__argValues[dI[2]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2276 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2277 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2278 |
case 4: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2279 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2280 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2281 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2282 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2283 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2284 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2285 |
case 5: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2286 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2287 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2288 |
__argValues[rI[4]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2289 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2290 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2291 |
__argValues[dI[4]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2292 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2293 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2294 |
case 6: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2295 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2296 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2297 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2298 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2299 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2300 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2301 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2302 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2303 |
case 7: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2304 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2305 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2306 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2307 |
__argValues[rI[6]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2308 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2309 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2310 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2311 |
__argValues[dI[6]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2312 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2313 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2314 |
case 8: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2315 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2316 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2317 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2318 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2319 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2320 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2321 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2322 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2323 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2324 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2325 |
case 9: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2326 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2327 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2328 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2329 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2330 |
__argValues[rI[8]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2331 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2332 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2333 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2334 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2335 |
__argValues[dI[8]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2336 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2337 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2338 |
case 10: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2339 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2340 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2341 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2342 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2343 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2344 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2345 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2346 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2347 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2348 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2349 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2350 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2351 |
case 11: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2352 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2353 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2354 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2355 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2356 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2357 |
__argValues[rI[10]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2358 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2359 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2360 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2361 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2362 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2363 |
__argValues[dI[10]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2364 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2365 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2366 |
case 12: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2367 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2368 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2369 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2370 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2371 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2372 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2373 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2374 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2375 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2376 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2377 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2378 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2379 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2380 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2381 |
case 13: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2382 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2383 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2384 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2385 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2386 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2387 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2388 |
__argValues[rI[12]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2389 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2390 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2391 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2392 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2393 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2394 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2395 |
__argValues[dI[12]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2396 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2397 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2398 |
case 14: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2399 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2400 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2401 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2402 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2403 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2404 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2405 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2406 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2407 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2408 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2409 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2410 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2411 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2412 |
__argValues[dI[12]].dVal, __argValues[dI[13]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2413 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2414 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2415 |
case 15: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2416 |
__returnValue.pointerVal = (*fi)( __argValues[rI[0]].pointerVal, __argValues[rI[1]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2417 |
__argValues[rI[2]].pointerVal, __argValues[rI[3]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2418 |
__argValues[rI[4]].pointerVal, __argValues[rI[5]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2419 |
__argValues[rI[6]].pointerVal, __argValues[rI[7]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2420 |
__argValues[rI[8]].pointerVal, __argValues[rI[9]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2421 |
__argValues[rI[10]].pointerVal, __argValues[rI[11]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2422 |
__argValues[rI[12]].pointerVal, __argValues[rI[13]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2423 |
__argValues[rI[14]].pointerVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2424 |
__argValues[dI[0]].dVal, __argValues[dI[1]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2425 |
__argValues[dI[2]].dVal, __argValues[dI[3]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2426 |
__argValues[dI[4]].dVal, __argValues[dI[5]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2427 |
__argValues[dI[6]].dVal, __argValues[dI[7]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2428 |
__argValues[dI[8]].dVal, __argValues[dI[9]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2429 |
__argValues[dI[10]].dVal, __argValues[dI[11]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2430 |
__argValues[dI[12]].dVal, __argValues[dI[13]].dVal, |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2431 |
__argValues[dI[14]].dVal |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2432 |
); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2433 |
break; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2434 |
default: |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2435 |
failureCode = @symbol(TooManyArguments); |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2436 |
goto getOutOfHere; |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2437 |
} |
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2438 |
} |
19931 | 2439 |
} |
2440 |
} |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2441 |
# endif // alternative to FFI |
19931 | 2442 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2443 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2444 |
printf("retval is %"_ld_" (0x%"_lx_")\n", (INT)(__returnValue.iVal), (INT)(__returnValue.iVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2445 |
}) |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
2446 |
|
11586 | 2447 |
if ((returnTypeSymbol == @symbol(int)) |
2448 |
|| (returnTypeSymbol == @symbol(sint)) |
|
9479 | 2449 |
|| (returnTypeSymbol == @symbol(sint8)) |
2450 |
|| (returnTypeSymbol == @symbol(sint16)) |
|
2451 |
|| (returnTypeSymbol == @symbol(sint32))) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2452 |
DEBUGCODE_IF( @global(Verbose), { |
19931 | 2453 |
printf("return int: %"_lx_"\n", (INT)(__returnValue.iVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2454 |
}) |
19535 | 2455 |
RETURN ( __MKINT(__returnValue.iVal) ); |
9342 | 2456 |
} |
2457 |
if ((returnTypeSymbol == @symbol(uint)) |
|
2458 |
|| (returnTypeSymbol == @symbol(uint8)) |
|
2459 |
|| (returnTypeSymbol == @symbol(uint16)) |
|
2460 |
|| (returnTypeSymbol == @symbol(uint32))) { |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2461 |
DEBUGCODE_IF( @global(Verbose), { |
19931 | 2462 |
printf("return uint: %"_lx_"\n", (INT)(__returnValue.iVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2463 |
}) |
19535 | 2464 |
RETURN ( __MKUINT(__returnValue.iVal) ); |
9342 | 2465 |
} |
10025
053904a63549
stc-compiled ExternalLibraryFunctions
Claus Gittinger <cg@exept.de>
parents:
9981
diff
changeset
|
2466 |
if (returnTypeSymbol == @symbol(bool)) { |
19535 | 2467 |
RETURN ( __returnValue.iVal ? true : false ); |
9342 | 2468 |
} |
2469 |
if (returnTypeSymbol == @symbol(float)) { |
|
19535 | 2470 |
RETURN ( __MKFLOAT(__returnValue.fVal )); |
9342 | 2471 |
} |
2472 |
if (returnTypeSymbol == @symbol(double)) { |
|
19535 | 2473 |
RETURN ( __MKFLOAT(__returnValue.dVal )); |
9342 | 2474 |
} |
2475 |
if (returnTypeSymbol == @symbol(void)) { |
|
19535 | 2476 |
RETURN ( nil ); |
9342 | 2477 |
} |
9463 | 2478 |
if (returnTypeSymbol == @symbol(char)) { |
19535 | 2479 |
RETURN ( __MKCHARACTER(__returnValue.iVal & 0xFF) ); |
9463 | 2480 |
} |
2481 |
if (returnTypeSymbol == @symbol(wchar)) { |
|
19535 | 2482 |
RETURN ( __MKUCHARACTER(__returnValue.iVal & 0xFFFF) ); |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
2483 |
} |
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
2484 |
if (returnTypeSymbol == @symbol(sint64)) { |
19356 | 2485 |
# if (__POINTER_SIZE__ == 8) |
19355 | 2486 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2487 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2488 |
printf("return sint64: %"_lx_"\n", (INT)(__returnValue.longLongVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2489 |
}) |
19535 | 2490 |
RETURN ( __MKINT(__returnValue.longLongVal) ); |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
2491 |
# else |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2492 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2493 |
printf("return sint64: %lx%08lx\n", __HI32(__returnValue.longLongVal), __LO32(__returnValue.longLongVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2494 |
}) |
19535 | 2495 |
RETURN ( __MKINT64(&__returnValue.longLongVal) ); |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
2496 |
# endif |
12504
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
2497 |
} |
c9987bb76eb6
untested long long return value
Claus Gittinger <cg@exept.de>
parents:
12503
diff
changeset
|
2498 |
if (returnTypeSymbol == @symbol(uint64)) { |
19356 | 2499 |
# if (__POINTER_SIZE__ == 8) |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2500 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2501 |
printf("return uint64: %"_lx_"\n", (unsigned INT)(__returnValue.longLongVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2502 |
}) |
19535 | 2503 |
RETURN ( __MKUINT(__returnValue.longLongVal) ); |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
2504 |
# else |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2505 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2506 |
printf("return sint64: %lx%08lx\n", __HI32(__returnValue.longLongVal), __LO32(__returnValue.longLongVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2507 |
}) |
19535 | 2508 |
RETURN ( __MKUINT64(&__returnValue.longLongVal) ); |
19314
698cf296ef6d
mingw64 and debugging stuff
Claus Gittinger <cg@exept.de>
parents:
19313
diff
changeset
|
2509 |
# endif |
9463 | 2510 |
} |
11586 | 2511 |
|
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2512 |
DEBUGCODE_IF( @global(Verbose), { |
19535 | 2513 |
printf("return pointer: %"_lx_"\n", (INT)(__returnValue.pointerVal)); |
20290
952d5b62a161
implemented a non-FFI-based callout scheme which works with OSX
Claus Gittinger <cg@exept.de>
parents:
20289
diff
changeset
|
2514 |
}) |
9346 | 2515 |
if (returnTypeSymbol == @symbol(handle)) { |
19535 | 2516 |
returnValue = __MKEXTERNALADDRESS(__returnValue.pointerVal); |
9346 | 2517 |
} else if (returnTypeSymbol == @symbol(pointer)) { |
19535 | 2518 |
returnValue = __MKEXTERNALBYTES(__returnValue.pointerVal); |
10603 | 2519 |
} else if (returnTypeSymbol == @symbol(bytePointer)) { |
19535 | 2520 |
returnValue = __MKEXTERNALBYTES(__returnValue.pointerVal); |
9463 | 2521 |
} else if (returnTypeSymbol == @symbol(charPointer)) { |
19535 | 2522 |
returnValue = __MKSTRING(__returnValue.pointerVal); |
9463 | 2523 |
} else if (returnTypeSymbol == @symbol(wcharPointer)) { |
19535 | 2524 |
returnValue = __MKU16STRING(__returnValue.pointerVal); |
9342 | 2525 |
} else { |
19535 | 2526 |
__FAIL__(@symbol(UnknownReturnType2)) |
9342 | 2527 |
} |
19931 | 2528 |
|
9342 | 2529 |
getOutOfHere: ; |
2530 |
%}. |
|
2531 |
failureCode notNil ifTrue:[ |
|
19535 | 2532 |
(failureCode == #UnknownReturnType or:[ failureCode == #UnknownArgumentType ]) ifTrue:[ |
2533 |
oldReturnType := returnType. |
|
2534 |
oldArgumentTypes := argumentTypes. |
|
2535 |
self adjustTypes. |
|
2536 |
((oldReturnType ~= returnType) or:[oldArgumentTypes ~= argumentTypes]) ifTrue:[ |
|
2537 |
thisContext restart |
|
2538 |
]. |
|
2539 |
]. |
|
2540 |
(failureCode == #BadArgForAsyncCall) ifTrue:[ |
|
2541 |
^ self tryAgainWithAsyncSafeArguments:argumentsOrNil forCPPInstance:aReceiverOrNil |
|
2542 |
]. |
|
2543 |
(failureCode == #FFINotSupported) ifTrue:[ |
|
2544 |
self primitiveFailed:'FFI support missing in this build'. |
|
2545 |
]. |
|
12579
516bba5b3e57
changed: #ffiTypeSymbolForType:
Claus Gittinger <cg@exept.de>
parents:
12504
diff
changeset
|
2546 |
|
19535 | 2547 |
self primitiveFailed. "see failureCode and failureInfo for details" |
2548 |
^ nil |
|
9342 | 2549 |
]. |
2550 |
||
9483 | 2551 |
returnType isSymbol ifTrue:[ |
19535 | 2552 |
returnValueClass notNil ifTrue:[ |
2553 |
self isConstReturnValue ifTrue:[ |
|
2554 |
returnValue changeClassTo:returnValueClass. |
|
2555 |
^ returnValue |
|
2556 |
]. |
|
2557 |
^ returnValueClass fromExternalAddress:returnValue. |
|
2558 |
]. |
|
9483 | 2559 |
] ifFalse:[ |
19535 | 2560 |
returnType isCPointer ifTrue:[ |
2561 |
returnType baseType isCStruct ifTrue:[ |
|
2562 |
stClass := Smalltalk classNamed:returnType baseType name. |
|
2563 |
stClass notNil ifTrue:[ |
|
2564 |
self isConstReturnValue ifTrue:[ |
|
2565 |
returnValue changeClassTo:returnValueClass. |
|
2566 |
^ returnValue |
|
2567 |
]. |
|
2568 |
^ stClass fromExternalAddress:returnValue. |
|
2569 |
]. |
|
2570 |
]. |
|
2571 |
returnType baseType isCChar ifTrue:[ |
|
2572 |
^ returnValue stringAt:1 |
|
2573 |
]. |
|
2574 |
]. |
|
9342 | 2575 |
]. |
2576 |
||
2577 |
^ returnValue |
|
9463 | 2578 |
|
2579 |
"Created: / 01-08-2006 / 13:56:23 / cg" |
|
19514 | 2580 |
"Modified: / 31-03-2016 / 00:03:03 / cg" |
14037 | 2581 |
! |
2582 |
||
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
2583 |
tryAgainWithAsyncSafeArguments:argumentsOrNil forCPPInstance:aReceiverOrNil |
14037 | 2584 |
"invoked by the call primitive, iff GC-unsave arguments where passed to the call. |
2585 |
Here, allocate non-movable blocks of memory and copy the arguments into them, |
|
2586 |
then try the call again, copy changed values back, and release the memeory." |
|
2587 |
||
2588 |
|saveArguments anyBadArg result originalToSaveArgMapping| |
|
2589 |
||
2590 |
argumentsOrNil isNil ifTrue:[ |
|
14625 | 2591 |
^ self primitiveFailed |
14037 | 2592 |
]. |
14506
e53548cdc24d
changed: #tryAgainWithAsyncSafeArguments:forCPPInstance:
anwild
parents:
14412
diff
changeset
|
2593 |
thisContext isRecursive ifTrue: [^self primitiveFailed]. |
14037 | 2594 |
|
2595 |
anyBadArg := false. |
|
2596 |
originalToSaveArgMapping := IdentityDictionary new. |
|
2597 |
||
14625 | 2598 |
saveArguments := argumentsOrNil |
2599 |
collect:[:eachArg | |
|
2600 |
|saveArg| |
|
14037 | 2601 |
|
14625 | 2602 |
(originalToSaveArgMapping includesKey:eachArg) ifTrue:[ |
2603 |
saveArg := originalToSaveArgMapping at:eachArg |
|
2604 |
] ifFalse:[ |
|
2605 |
eachArg isString ifTrue:[ |
|
2606 |
saveArg := (ExternalBytes fromString:eachArg) register. |
|
2607 |
anyBadArg := true. |
|
2608 |
originalToSaveArgMapping at:eachArg put:saveArg. |
|
2609 |
] ifFalse:[ |
|
2610 |
eachArg isByteCollection ifTrue:[ |
|
2611 |
saveArg := (ExternalBytes from:eachArg) register. |
|
2612 |
originalToSaveArgMapping at:eachArg put:saveArg. |
|
2613 |
anyBadArg := true. |
|
2614 |
] ifFalse:[ |
|
2615 |
saveArg := eachArg |
|
2616 |
] |
|
2617 |
]. |
|
2618 |
]. |
|
2619 |
saveArg |
|
2620 |
]. |
|
14037 | 2621 |
|
2622 |
anyBadArg ifFalse:[ |
|
14625 | 2623 |
"avoid recursion..." |
2624 |
^ self primitiveFailed |
|
14037 | 2625 |
]. |
2626 |
||
14659
410089913ca1
allow use of the standard (system) ffi
Claus Gittinger <cg@exept.de>
parents:
14632
diff
changeset
|
2627 |
result := self invokeFFIwithArguments:saveArguments forCPPInstance:aReceiverOrNil. |
14037 | 2628 |
|
2629 |
"/ copy back !! |
|
2630 |
originalToSaveArgMapping keysAndValuesDo:[:arg :saveArg | |
|
14625 | 2631 |
arg isSymbol ifFalse:[ |
2632 |
arg replaceFrom:1 to:(arg size) with:saveArg startingAt:1. |
|
2633 |
]. |
|
2634 |
saveArg free. |
|
14037 | 2635 |
]. |
2636 |
^ result. |
|
14506
e53548cdc24d
changed: #tryAgainWithAsyncSafeArguments:forCPPInstance:
anwild
parents:
14412
diff
changeset
|
2637 |
|
e53548cdc24d
changed: #tryAgainWithAsyncSafeArguments:forCPPInstance:
anwild
parents:
14412
diff
changeset
|
2638 |
"Modified (format): / 06-11-2012 / 10:52:41 / anwild" |
9342 | 2639 |
! ! |
2640 |
||
10481 | 2641 |
!ExternalLibraryFunction methodsFor:'testing'! |
2642 |
||
10603 | 2643 |
isExternalLibraryFunction |
2644 |
"return true, if the receiver is some kind of externalLibrary function; |
|
2645 |
true is returned here" |
|
2646 |
||
2647 |
^true |
|
2648 |
||
2649 |
"Created: / 07-06-2007 / 10:36:40 / cg" |
|
10481 | 2650 |
! ! |
2651 |
||
8533 | 2652 |
!ExternalLibraryFunction class methodsFor:'documentation'! |
2653 |
||
19487 | 2654 |
version |
2655 |
^ '$Header$' |
|
2656 |
! |
|
2657 |
||
13412 | 2658 |
version_CVS |
19311 | 2659 |
^ '$Header$' |
12436 | 2660 |
! |
2661 |
||
13412 | 2662 |
version_SVN |
19311 | 2663 |
^ '$ Id: ExternalLibraryFunction.st 10643 2011-06-08 21:53:07Z vranyj1 $' |
8533 | 2664 |
! ! |
9463 | 2665 |
|
19311 | 2666 |
|
9463 | 2667 |
ExternalLibraryFunction initialize! |