Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[windows] fix the detection of 32/64 bits
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Sep 2015 00:42:19 +0000 (02:42 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Sep 2015 00:45:23 +0000 (02:45 +0200)
Funny fact: _WIN32 is also defined in 64 bits mode

src/xbt/win32_ucontext.c
tools/cmake/MakeLibWin.cmake

index a1b00d3..80dd2e5 100644 (file)
@@ -65,12 +65,12 @@ int makecontext(ucontext_t * ucp, void (*func) (), int argc, ...)
   }
   
       /* Set the instruction and the stack pointer */
-  #if defined(_I_X86_) || defined(__i386) || defined(__i386__) || defined(_WIN32)
+  #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*);
   #elif defined(_IA64_) || defined(__ia64) || defined(__ia64__)
   #  error "_IA64_"
-  #elif defined _AMD64_ || defined(__x86_64) || defined(__x86_64__) || defined(_WIN64)
+  #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
index 59f0557..8f77f3d 100644 (file)
@@ -7,10 +7,6 @@ if(MSVC)
   set_target_properties(simgrid  PROPERTIES 
        COMPILE_FLAGS "/D_XBT_DLL_EXPORT /DDLL_EXPORT" 
        VERSION ${libsimgrid_version} )
-#       PREFIX "lib" SUFFIX ".dll"
-#       IMPORT_PREFIX "lib"
-#       IMPORT_SUFFIX ".dll")
-#  ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/lib/Debug
 else()
   set_target_properties(simgrid  PROPERTIES 
        COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT"