- /* Set the instruction and the stack pointer */ \r
- ucp->uc_mcontext.Eip = (unsigned long) func;\r
- ucp->uc_mcontext.Esp = (unsigned long) sp - 4;\r
- \r
+ /* Set the instruction and the stack pointer */\r
+ #ifdef _I_X86_\r
+ ucp->uc_mcontext.Eip = (DWORD) func;\r
+ ucp->uc_mcontext.Esp = (DWORD) sp - sizeof(void*);\r
+ #endif\r
+ #ifdef _IA64_\r
+ # error "_IA64_"\r
+ #endif\r
+ #ifdef _AMD64_\r
+ ucp->uc_mcontext.Rip = (DWORD64) func;\r
+ ucp->uc_mcontext.Rsp = (DWORD64) sp - sizeof(void*);\r
+ #endif\r
+\r