On Fri, Aug 10, 2012 at 7:37 PM, Dan Kegel dank@kegel.com wrote:
Yes indeed, this works:
extern void WINAPIV VCOMP__vcomp_fork(DWORD parallel, int ncount, void (__cdecl *helper)(__ms_va_list), ...); __ASM_GLOBAL_FUNC( VCOMP__vcomp_fork, "pop %eax\n\t" /* save return address */ "add $8,%esp\n\t" /* skip parallel and ncount */ "pop %ebx\n\t" /* save helper */ "push %eax\n\t" /* set up return address */ "jmp %ebx" /* enter handler */ )
(Or maybe %edx instead of %ebx; http://en.wikipedia.org/wiki/X86_calling_conventions suggests %ebx shouldn't be modified by the callee.)