// A little trickery as the C++ standard doesn't allow direct
// conversion between function pointer and data pointer
union{asFUNCTION_tfunc;asPWORDidx;}u;
u.func=func;
returnu.idx;
}
enuminternalCallConv
{
ICC_GENERIC_FUNC,
ICC_GENERIC_FUNC_RETURNINMEM,// never used
ICC_CDECL,
ICC_CDECL_RETURNINMEM,
ICC_STDCALL,
ICC_STDCALL_RETURNINMEM,
ICC_THISCALL,
ICC_THISCALL_RETURNINMEM,
ICC_VIRTUAL_THISCALL,
ICC_VIRTUAL_THISCALL_RETURNINMEM,
ICC_CDECL_OBJLAST,
ICC_CDECL_OBJLAST_RETURNINMEM,
ICC_CDECL_OBJFIRST,
ICC_CDECL_OBJFIRST_RETURNINMEM,
ICC_GENERIC_METHOD,
ICC_GENERIC_METHOD_RETURNINMEM,// never used
ICC_THISCALL_OBJLAST,
ICC_THISCALL_OBJLAST_RETURNINMEM,
ICC_VIRTUAL_THISCALL_OBJLAST,
ICC_VIRTUAL_THISCALL_OBJLAST_RETURNINMEM,
ICC_THISCALL_OBJFIRST,
ICC_THISCALL_OBJFIRST_RETURNINMEM,
ICC_VIRTUAL_THISCALL_OBJFIRST,
ICC_VIRTUAL_THISCALL_OBJFIRST_RETURNINMEM
};
structasSSystemFunctionInterface
{
asFUNCTION_tfunc;
intbaseOffset;
internalCallConvcallConv;
boolhostReturnInMemory;
boolhostReturnFloat;
inthostReturnSize;
intparamSize;
booltakesObjByVal;
asCArray<bool>paramAutoHandles;// TODO: Should be able to remove this array. Perhaps the flags can be stored together with the inOutFlags in asCScriptFunction?
boolreturnAutoHandle;
intcompositeOffset;
boolisCompositeIndirect;
void*auxiliary;// can be used for functors, e.g. by asCALL_THISCALL_ASGLOBAL or asCALL_THISCALL_OBJFIRST
structSClean
{
asCObjectType*ot;// argument type for clean up
shortop;// clean up operation: 0 = release, 1 = free, 2 = destruct then free