|
From: Jeff S. <js...@de...> - 2001-01-08 03:53:24
|
On Sun, 7 Jan 2001, Dan Egnor wrote: > It should be possible to port this code, though it would take someone who > is pretty wizzy with GCC asm() and Win32 calling conventions. It may be > that something similar happens in the guts of w32api -- I've never looked > there. The biggest issue is making sure that the stack frame you're building > isn't clobbered halfway through by GCC; I'd recommend refactoring the code to > construct the entire frame in a char[] buffer in C, then entering one final > asm() statement to adjust the stack pointer, call the actual function, and > clean up. There is another free software project, libffi, which serves a similar purpose. It compiles under gcc and utilizes both inline asm and standalone asm. Though libffi is not yet ported to mingw, the SVR4 calling conventions are similar so it is not much work. At least, you might consult http://sources.redhat.com/libffi/ for ideas before rewriting the whole lot yourself. Jeff |