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