For that you need to tell it to the luajit ffi module.
There is no way for LuaJIT to know what arguments were needed. Or
there is a way, but its very compiler specific. For example one can
probably get arguments through the PDB file generated for Microsoft
Visual Studio, but this is not a general solution, and in my opinion
out of luajit's scope.
There are plenty of ffi-bindings - http://wiki.luajit.org/FFI-Bindings
- and luajit so far has offered the easiest way to write them. In
comparison boost/python, swig, etc. are much harder.
WIth that said, there is less support for C++ - so you need to export
your api as "C" and declare it with the ffi module.
These bindings would surely help you, and you might even find the ones you need:
http://wiki.luajit.org/FFI-Bindings
For example this: http://luapower.com/winapi - if you are on Windows
or this for more unix systems - https://github.com/justincormack/ljsyscall
On Sat, Aug 23, 2014 at 12:11 PM, Amir Ramezani
Post by Amir Ramezaniso, how can i get the function's address? where it plases on the
memory, where the return value gos and where can i find the
parameters?
and, how can i know that is a class and how can i save my other
functions that is called by this function into the executable?
Post by malkiaThe first time a function is called, the stack position (SP/ESP in x86
land) is saved before calling.
Then after the function has been called it's checked again - so from
the first call, and whether there
was difference (caller must restore the stack, e.g. cdecl) or no
(callee must restore stack, e.g. pascal calling convention) that was
later reused on subsequent calls.
Pretty smart if you ask me :) I would've never thought in the first place.
On Sat, Aug 23, 2014 at 8:22 AM, Amir Ramezani
Post by Amir Ramezanihi all,
i'm using AngelScript in my engine
i want to use luajit instead
i want to develop a compiler with luajit and LLVM
how can i detect the calling convention that is used
by luajit?
thanks in advance
--
Dimiter "malkia" Stanev,
ICQ: 21875894
--
Dimiter "malkia" Stanev,
ICQ: 21875894
malkia-***@public.gmane.org
malkia-***@public.gmane.org