-/* Copyright (c) 2010-2012, 2014. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include "win32_ucontext.h"
+#include "xbt/win32_ucontext.h"
int getcontext(ucontext_t * ucp)
{
}
/* Set the instruction and the stack pointer */
- #ifdef _I_X86_
+ #if defined(_I_X86_) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
ucp->uc_mcontext.Eip = (DWORD) func;
ucp->uc_mcontext.Esp = (DWORD) sp - sizeof(void*);
- #endif
- #ifdef _IA64_
+ #elif defined(_IA64_) || defined(__ia64) || defined(__ia64__)
# error "_IA64_"
- #endif
- #ifdef _AMD64_
+ #elif defined _AMD64_ || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
ucp->uc_mcontext.Rip = (DWORD64) func;
ucp->uc_mcontext.Rsp = (DWORD64) sp - sizeof(void*);
+ #else
+ #error "No architecture defined for Windows build."
#endif
/* Save/Restore the full machine context */
}
return ret;
}
-