import "native/native";
function native_call(func: Pointer, sig: String[, <up to 16 parameters>]): Dynamic
function native_call_args(func: Pointer, sig: String, args: Dynamic[]): Dynamic
$
- use STDCALL calling convention (used on Windows 32-bit only, ignored elsewhere)+
- function uses variable number of arguments (used on ARM, ignored elsewhere)v
- void (used only for return values)i
- 32-bit integer (corresponds to C's int
type)l
- 64-bit integer (corresponds to C's int64_t
type)n
- 32/64-bit integer (corresponds to C's long
type)f
- 32-bit float (corresponds to C's float
type)d
- 64-bit float (corresponds to C's double
type)p
- 32/64-bit pointer (corresponds to C's void *
type)int
.
Passing of 64-bit numbers is done by using two parameters, the low part and then
the high part. Pointers are passed using the Pointer type.
When calling functions with variable amount of arguments (varargs), remember
that any float
s are always passed as double
s.