Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill our _XBT_WIN32. Standard _WIN32 is sufficient
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 6 Mar 2016 20:58:37 +0000 (21:58 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 6 Mar 2016 20:58:37 +0000 (21:58 +0100)
17 files changed:
CMakeLists.txt
include/simgrid_config.h.in
src/mc/mc_base.cpp
src/mc/mc_global.cpp
src/portable.h
src/simdag/dax_dtd.c
src/simgrid/sg_config.c
src/simix/RawContext.cpp
src/simix/smx_context.cpp
src/surf/xml/simgrid_dtd.c
src/xbt/ex.c
src/xbt/parmap.cpp
src/xbt/xbt_main.c
teshsuite/simdag/platforms/flatifier.cpp
tools/cmake/MaintainerMode.cmake
tools/cmake/src/internal_config.h.in
tools/graphicator/graphicator.c

index 18f50ca..3e68ce7 100644 (file)
@@ -170,7 +170,6 @@ ENDIF()
 
 if(WIN32)
 
 
 if(WIN32)
 
-  #Need env INCLUDE
   set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
   set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
   string(REGEX REPLACE "/bin/gcc.*" "/include"  CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
   set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
   set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
   string(REGEX REPLACE "/bin/gcc.*" "/include"  CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
@@ -178,8 +177,6 @@ if(WIN32)
   set(INCLUDES ${INCLUDES} ${CMAKE_INCLUDE_WIN})
   unset(CMAKE_INCLUDE_WIN)
 
   set(INCLUDES ${INCLUDES} ${CMAKE_INCLUDE_WIN})
   unset(CMAKE_INCLUDE_WIN)
 
-  set(_XBT_WIN32 1)
-
 endif()
 
 include_directories(${INCLUDES})
 endif()
 
 include_directories(${INCLUDES})
@@ -514,23 +511,11 @@ endif()
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_definitions(-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE)
 endif()
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_definitions(-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE)
 endif()
-
-if(WIN32)
-  # We always provide our own implementation of ucontext on Windows.
-  try_compile(HAVE_UCONTEXT
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_AC_CHECK_MCSC.c
-    COMPILE_DEFINITIONS -D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt
-  )
-else()
-  # We always provide our own implementation of ucontext on Windows.
-  try_compile(HAVE_UCONTEXT
+try_compile(HAVE_UCONTEXT
     ${CMAKE_BINARY_DIR}
     ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_AC_CHECK_MCSC.c)
     ${CMAKE_BINARY_DIR}
     ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_AC_CHECK_MCSC.c)
-endif()
 
 #If can have both context
 
 #If can have both context
-
 if(HAVE_UCONTEXT)
   set(HAVE_UCONTEXT_CONTEXTS 1)
   message("-- Support for ucontext factory")
 if(HAVE_UCONTEXT)
   set(HAVE_UCONTEXT_CONTEXTS 1)
   message("-- Support for ucontext factory")
@@ -604,15 +589,6 @@ if(HAVE_UCONTEXT_H)
     set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE=700")
   endif()
 
     set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE=700")
   endif()
 
-  if(WIN32)
-    if(ARCH_32_BITS)
-      set(makecontext_CPPFLAGS "-DTEST_makecontext -D_I_X86_")
-    else()
-      set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_")
-    endif()
-    set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt")
-  endif()
-
   file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
 
   if(CMAKE_CROSSCOMPILING)
   file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
 
   if(CMAKE_CROSSCOMPILING)
@@ -635,8 +611,6 @@ if(HAVE_UCONTEXT_H)
     string(REPLACE "," "" makecontext_size "${MAKECONTEXT_SIZE}")
     set(pth_skaddr_makecontext "#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
     set(pth_sksize_makecontext "#define pth_sksize_makecontext(skaddr,sksize) (${makecontext_size})")
     string(REPLACE "," "" makecontext_size "${MAKECONTEXT_SIZE}")
     set(pth_skaddr_makecontext "#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
     set(pth_sksize_makecontext "#define pth_sksize_makecontext(skaddr,sksize) (${makecontext_size})")
-  else()
-    # message(FATAL_ERROR "makecontext is not compilable")
   endif()
 endif()
 
   endif()
 endif()
 
index 47e50f5..10f75e0 100644 (file)
                                              SIMGRID_VERSION_MINOR, \
                                              SIMGRID_VERSION_PATCH)
 
                                              SIMGRID_VERSION_MINOR, \
                                              SIMGRID_VERSION_PATCH)
 
-#cmakedefine _XBT_WIN32 @_XBT_WIN32@   /*this variable is set if it is a windows platform*/
-#cmakedefine _WIN32 @_WIN32@                   /*this variable is set if it is a 32 bits windows platform*/
-#cmakedefine _WIN64 @_WIN64@                   /*this variable is set if it is a 64 bits  windows platform*/
-
 /* Define to 1 if you have the <unistd.h> header file. */
 #cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
 
index ceed72a..e8f1bb4 100644 (file)
@@ -199,7 +199,7 @@ static int prng_random(int min, int max)
   // Use rejection in order to avoid skew
   unsigned long x;
   do {
   // Use rejection in order to avoid skew
   unsigned long x;
   do {
-#ifndef _XBT_WIN32
+#ifndef _WIN32
     x = (unsigned long) random();
 #else
     x = (unsigned long) rand();
     x = (unsigned long) random();
 #else
     x = (unsigned long) rand();
index da49931..1fc984e 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "mc/mc.h"
 
 
 #include "mc/mc.h"
 
-#ifndef _XBT_WIN32
+#ifndef _WIN32
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/time.h>
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/time.h>
index f610526..9e5adda 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "xbt/base.h"
 #include "xbt/misc.h"
 
 #include "xbt/base.h"
 #include "xbt/misc.h"
-#ifdef _XBT_WIN32
+#ifdef _WIN32
 # include <windows.h>
 #endif
 
 # include <windows.h>
 #endif
 
@@ -39,7 +39,7 @@
 
 #include <fcntl.h>
 
 
 #include <fcntl.h>
 
-#ifdef _XBT_WIN32
+#ifdef _WIN32
   #ifndef EWOULDBLOCK
   #define EWOULDBLOCK WSAEWOULDBLOCK
   #endif
   #ifndef EWOULDBLOCK
   #define EWOULDBLOCK WSAEWOULDBLOCK
   #endif
index a9f46f3..be760b5 100644 (file)
@@ -1313,7 +1313,7 @@ const char dax__flexml_version[] = "1.9.6";
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
 # ifndef __STRICT_ANSI__
 #  include <io.h>
 #  include <process.h>
 # ifndef __STRICT_ANSI__
 #  include <io.h>
 #  include <process.h>
@@ -1601,7 +1601,7 @@ const char* *dax__statenames=NULL;
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
-#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_WIN32)
 #  ifndef __STRICT_ANSI__
 #    include <io.h>
 #    include <process.h>
 #  ifndef __STRICT_ANSI__
 #    include <io.h>
 #    include <process.h>
index ae2e69a..02de65b 100644 (file)
@@ -721,7 +721,7 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register(&_sg_cfg_set, "contexts/guard_size",
                      "Guard size for contexts stacks in memory pages",
                      xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_guard_size);
     xbt_cfg_register(&_sg_cfg_set, "contexts/guard_size",
                      "Guard size for contexts stacks in memory pages",
                      xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_guard_size);
-#if defined(_XBT_WIN32) || (PTH_STACKGROWTH != -1)
+#if defined(_WIN32) || (PTH_STACKGROWTH != -1)
     xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 0);
 #else
     xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 1);
     xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 0);
 #else
     xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 1);
index bb1af0a..e494570 100644 (file)
@@ -128,7 +128,7 @@ __asm__ (
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
-#elif defined(_XBT_WIN32)
+#elif defined(_WIN32)
    ".text\n"
    ".globl raw_makecontext\n"
    "raw_makecontext:\n"
    ".text\n"
    ".globl raw_makecontext\n"
    "raw_makecontext:\n"
@@ -164,7 +164,7 @@ __asm__ (
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
-#elif defined(_XBT_WIN32)
+#elif defined(_WIN32)
    ".text\n"
    ".globl raw_swapcontext\n"
    "raw_swapcontext:\n"
    ".text\n"
    ".globl raw_swapcontext\n"
    "raw_swapcontext:\n"
@@ -204,7 +204,7 @@ __asm__ (
 );
 #elif PROCESSOR_i686
 __asm__ (
 );
 #elif PROCESSOR_i686
 __asm__ (
-#if defined(APPLE) || defined(_XBT_WIN32)
+#if defined(APPLE) || defined(_WIN32)
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
    ".text\n"
    ".globl _raw_makecontext\n"
    "_raw_makecontext:\n"
@@ -231,7 +231,7 @@ __asm__ (
 );
 
 __asm__ (
 );
 
 __asm__ (
-#if defined(APPLE) || defined(_XBT_WIN32)
+#if defined(APPLE) || defined(_WIN32)
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
    ".text\n"
    ".globl _raw_swapcontext\n"
    "_raw_swapcontext:\n"
index e88b271..75ddf21 100644 (file)
@@ -17,7 +17,7 @@
 #include "simgrid/modelchecker.h"
 
 
 #include "simgrid/modelchecker.h"
 
 
-#ifdef _XBT_WIN32
+#ifdef _WIN32
 #include <windows.h>
 #include <malloc.h>
 #else
 #include <windows.h>
 #include <malloc.h>
 #else
@@ -127,7 +127,7 @@ void *SIMIX_context_stack_new(void)
 
   if (smx_context_guard_size > 0 && !MC_is_active()) {
 
 
   if (smx_context_guard_size > 0 && !MC_is_active()) {
 
-#if defined(_XBT_WIN32) || (PTH_STACKGROWTH != -1)
+#if defined(_WIN32) || (PTH_STACKGROWTH != -1)
     static int warned_once = 0;
     if (!warned_once) {
       XBT_WARN("Stack overflow protection is known to be broken on your system.  Either you're on Windows or PTH_STACKGROWTH != -1 (current value is %d).",
     static int warned_once = 0;
     if (!warned_once) {
       XBT_WARN("Stack overflow protection is known to be broken on your system.  Either you're on Windows or PTH_STACKGROWTH != -1 (current value is %d).",
@@ -143,14 +143,14 @@ void *SIMIX_context_stack_new(void)
     char *alloc = (char*)xbt_malloc0(size + xbt_pagesize);
     stack = alloc - ((uintptr_t)alloc & (xbt_pagesize - 1)) + xbt_pagesize;
     *((void **)stack - 1) = alloc;
     char *alloc = (char*)xbt_malloc0(size + xbt_pagesize);
     stack = alloc - ((uintptr_t)alloc & (xbt_pagesize - 1)) + xbt_pagesize;
     *((void **)stack - 1) = alloc;
-#elif !defined(_XBT_WIN32)
+#elif !defined(_WIN32)
     if (posix_memalign(&stack, xbt_pagesize, size) != 0)
       xbt_die("Failed to allocate stack.");
 #else
     stack = _aligned_malloc(size, xbt_pagesize);
 #endif
 
     if (posix_memalign(&stack, xbt_pagesize, size) != 0)
       xbt_die("Failed to allocate stack.");
 #else
     stack = _aligned_malloc(size, xbt_pagesize);
 #endif
 
-#ifndef _XBT_WIN32
+#ifndef _WIN32
     if (mprotect(stack, smx_context_guard_size, PROT_NONE) == -1) {
       xbt_die("Failed to protect stack: %s", strerror(errno));
       /* This is fatal. We are going to fail at some point when
     if (mprotect(stack, smx_context_guard_size, PROT_NONE) == -1) {
       xbt_die("Failed to protect stack: %s", strerror(errno));
       /* This is fatal. We are going to fail at some point when
@@ -184,7 +184,7 @@ void SIMIX_context_stack_delete(void *stack)
   VALGRIND_STACK_DEREGISTER(valgrind_stack_id);
 #endif
 
   VALGRIND_STACK_DEREGISTER(valgrind_stack_id);
 #endif
 
-#ifndef WIN32
+#ifndef _WIN32
   if (smx_context_guard_size > 0 && !MC_is_active()) {
     stack = (char *)stack - smx_context_guard_size;
     if (mprotect(stack, smx_context_guard_size,
   if (smx_context_guard_size > 0 && !MC_is_active()) {
     stack = (char *)stack - smx_context_guard_size;
     if (mprotect(stack, smx_context_guard_size,
index b2d329e..8f9d90f 100644 (file)
@@ -4568,7 +4568,7 @@ const char surfxml_flexml_version[] = "1.9.6";
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
 # ifndef __STRICT_ANSI__
 #  include <io.h>
 #  include <process.h>
 # ifndef __STRICT_ANSI__
 #  include <io.h>
 #  include <process.h>
@@ -5222,7 +5222,7 @@ const char* *surfxml_statenames=NULL;
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
  * down here because we want the user's section 1 to have been scanned first.
  * The user has a chance to override it with an option.
  */
-#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_WIN32)
 #  ifndef __STRICT_ANSI__
 #    include <io.h>
 #    include <process.h>
 #  ifndef __STRICT_ANSI__
 #    include <io.h>
 #    include <process.h>
@@ -5991,8 +5991,8 @@ YY_RULE_SETUP
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */
   switch (YY_START) {
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_AS: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
   }
  }
        YY_BREAK
   }
  }
        YY_BREAK
@@ -6016,8 +6016,8 @@ YY_RULE_SETUP
   ETag_surfxml_ASroute();
   popbuffer(); /* attribute */
   switch (YY_START) {
   ETag_surfxml_ASroute();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_AS: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
   }
  }
        YY_BREAK
   }
  }
        YY_BREAK
index 680b110..7a04ac6 100644 (file)
@@ -61,7 +61,7 @@
 # define HAVE_BACKTRACE 1       /* Hello linux box */
 #endif
 
 # define HAVE_BACKTRACE 1       /* Hello linux box */
 #endif
 
-#if defined(_XBT_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
+#if defined(_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
 # define HAVE_BACKTRACE 1       /* Hello x86 windows box */
 #endif
 
 # define HAVE_BACKTRACE 1       /* Hello x86 windows box */
 #endif
 
@@ -126,7 +126,7 @@ void xbt_backtrace_display_current(void)
 
 #if defined(HAVE_EXECINFO_H) && defined(HAVE_POPEN) && defined(ADDR2LINE)
 # include "src/xbt/backtrace_linux.c"
 
 #if defined(HAVE_EXECINFO_H) && defined(HAVE_POPEN) && defined(ADDR2LINE)
 # include "src/xbt/backtrace_linux.c"
-#elif (defined(_XBT_WIN32) && defined (_M_IX86)) && !defined(__GNUC__)
+#elif (defined(_WIN32) && defined (_M_IX86)) && !defined(__GNUC__)
 # include "src/xbt/backtrace_windows.c"
 #else
 # include "src/xbt/backtrace_dummy.c"
 # include "src/xbt/backtrace_windows.c"
 #else
 # include "src/xbt/backtrace_dummy.c"
index 88431cc..8dff2fe 100644 (file)
@@ -11,7 +11,7 @@
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
-#ifndef _XBT_WIN32
+#ifndef _WIN32
 #include <sys/syscall.h>
 #endif
 
 #include <sys/syscall.h>
 #endif
 
index 7c6795f..ff685cd 100644 (file)
@@ -9,7 +9,7 @@
 #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */
 
 #include "xbt/misc.h"
 #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */
 
 #include "xbt/misc.h"
-#include "simgrid_config.h"     /* _XBT_WIN32 */
+#include "simgrid_config.h"
 #include "src/internal_config.h" /* MMALLOC_WANT_OVERRIDE_LEGACY */
 #include "src/portable.h"
 #include "xbt/sysdep.h"
 #include "src/internal_config.h" /* MMALLOC_WANT_OVERRIDE_LEGACY */
 #include "src/portable.h"
 #include "xbt/sysdep.h"
@@ -24,8 +24,8 @@
 #include "simgrid/sg_config.h"
 
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 
 #include <stdio.h>
-#ifdef _XBT_WIN32
-#include <signal.h>
+#ifdef _WIN32
+#include <signal.h> /* To silence MSVC on abort() */
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
@@ -48,7 +48,7 @@ int xbt_pagebits = 0;
 static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
 static void xbt_postexit(void);
 
 static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200);
 static void xbt_postexit(void);
 
-#ifdef _XBT_WIN32
+#ifdef _WIN32
 # undef _XBT_NEED_INIT_PRAGMA
 #endif
 
 # undef _XBT_NEED_INIT_PRAGMA
 #endif
 
@@ -56,14 +56,10 @@ static void xbt_postexit(void);
 #pragma init (xbt_preinit)
 #endif
 
 #pragma init (xbt_preinit)
 #endif
 
-#ifdef _XBT_WIN32
+#ifdef _WIN32
 #include <windows.h>
 
 #ifndef __GNUC__
 #include <windows.h>
 
 #ifndef __GNUC__
-/* Dummy prototype to make gcc happy */
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
-                    LPVOID lpvReserved);
-
 /* Should not be necessary but for some reason,
  * DllMain is called twice at attachment and
  * at detachment.*/
 /* Should not be necessary but for some reason,
  * DllMain is called twice at attachment and
  * at detachment.*/
@@ -71,8 +67,7 @@ static int xbt_dll_process_is_attached = 0;
 
 /* see also http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx */
 /* and http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx */
 
 /* see also http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx */
 /* and http://www.microsoft.com/whdc/driver/kernel/DLL_bestprac.mspx */
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
-                    LPVOID lpvReserved)
+static BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
   if (fdwReason == DLL_PROCESS_ATTACH
       && xbt_dll_process_is_attached == 0) {
 {
   if (fdwReason == DLL_PROCESS_ATTACH
       && xbt_dll_process_is_attached == 0) {
@@ -90,7 +85,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
 
 static void xbt_preinit(void) {
   unsigned int seed = 2147483647;
 
 static void xbt_preinit(void) {
   unsigned int seed = 2147483647;
-#ifndef _XBT_WIN32
+#ifndef _WIN32
   xbt_pagesize = sysconf(_SC_PAGESIZE);
 #else
   SYSTEM_INFO si;
   xbt_pagesize = sysconf(_SC_PAGESIZE);
 #else
   SYSTEM_INFO si;
@@ -115,7 +110,7 @@ static void xbt_preinit(void) {
   xbt_dict_preinit();
    
   srand(seed);
   xbt_dict_preinit();
    
   srand(seed);
-#ifndef _XBT_WIN32
+#ifndef _WIN32
   srand48(seed);
 #endif
   atexit(xbt_postexit);
   srand48(seed);
 #endif
   atexit(xbt_postexit);
@@ -184,7 +179,7 @@ void xbt_abort(void)
   extern void __gcov_flush(void);
   __gcov_flush();
 #endif
   extern void __gcov_flush(void);
   __gcov_flush();
 #endif
-#ifdef _XBT_WIN32
+#ifdef _WIN32
   /* It was said *in silence*.  We don't want to see the error message printed
    * by the Microsoft's implementation of abort(). */
   raise(SIGABRT);
   /* It was said *in silence*.  We don't want to see the error message printed
    * by the Microsoft's implementation of abort(). */
   raise(SIGABRT);
index b70a591..fec3e12 100644 (file)
@@ -4,7 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef _XBT_WIN32
+#include "src/internal_config.h"
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
index 91f86d6..51e01cf 100644 (file)
@@ -138,8 +138,7 @@ if(enable_maintainer_mode AND NOT WIN32)
     set(string1  "'s/extern *\\([^(]*\\)\\( \\|\\( \\*\\)\\)/XBT_PUBLIC_DATA(\\1\\3) /'")
     set(string2  "'s/XBT_PUBLIC_DATA(\\([^)]*\\)) *\\([^(]*\\)(/XBT_PUBLIC(\\1) \\2(/'")
     set(string5  "'s/SET(DOCTYPE)/SET(ROOT_dax__adag)/'")
     set(string1  "'s/extern *\\([^(]*\\)\\( \\|\\( \\*\\)\\)/XBT_PUBLIC_DATA(\\1\\3) /'")
     set(string2  "'s/XBT_PUBLIC_DATA(\\([^)]*\\)) *\\([^(]*\\)(/XBT_PUBLIC(\\1) \\2(/'")
     set(string5  "'s/SET(DOCTYPE)/SET(ROOT_dax__adag)/'")
-    set(string8  "'s/#if defined(_WIN32)/#if defined(_XBT_WIN32)/g'")
-    set(string9  "'s/#include <unistd.h>/#if defined(_XBT_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\\n#  ifndef __STRICT_ANSI__\\n#    include <io.h>\\n#    include <process.h>\\n#  endif\\n#else\\n#  include <unistd.h>\\n#endif/g'")
+    set(string9  "'s/#include <unistd.h>/#if defined(_WIN32)\\n#  ifndef __STRICT_ANSI__\\n#    include <io.h>\\n#    include <process.h>\\n#  endif\\n#else\\n#  include <unistd.h>\\n#endif/g'")
     set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'")
     set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'")
 
     set(string14 "'\\!^ \\* Generated [0-9/]\\{10\\} [0-9:]\\{8\\}\\.$$!d'")
     set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'")
 
@@ -182,7 +181,6 @@ if(enable_maintainer_mode AND NOT WIN32)
 
       #surf/xml/simgrid_dtd.c: surf/xml/simgrid_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
 
       #surf/xml/simgrid_dtd.c: surf/xml/simgrid_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i ${string8} src/surf/xml/simgrid_dtd.l
       COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l
       COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c
       COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c
       COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l
       COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c
       COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c
@@ -192,7 +190,6 @@ if(enable_maintainer_mode AND NOT WIN32)
 
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
-      COMMAND ${SED_EXE} -i ${string8} src/simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/simdag
       COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string9}                        src/simdag/dax_dtd.c
       COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/simdag
       COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string9}                        src/simdag/dax_dtd.c
index 7fd37b1..a9a62ed 100644 (file)
@@ -21,9 +21,6 @@
 #ifndef _M_IX86
        #cmakedefine _M_IX86 @_M_IX86@
 #endif
 #ifndef _M_IX86
        #cmakedefine _M_IX86 @_M_IX86@
 #endif
-#cmakedefine _XBT_WIN32 @_XBT_WIN32@   // this variable is set if it is a windows platform
-#cmakedefine _WIN32 @_WIN32@           // this variable is set if it is a 32 bits windows platform
-#cmakedefine _WIN64 @_WIN64@           // this variable is set if it is a 64 bits  windows platform
 #cmakedefine APPLE @APPLE@
 /* Set to true if enable_model-checking is true */
 #cmakedefine MMALLOC_WANT_OVERRIDE_LEGACY @MMALLOC_WANT_OVERRIDE_LEGACY@
 #cmakedefine APPLE @APPLE@
 /* Set to true if enable_model-checking is true */
 #cmakedefine MMALLOC_WANT_OVERRIDE_LEGACY @MMALLOC_WANT_OVERRIDE_LEGACY@
index bffc21a..a32e74c 100644 (file)
@@ -4,15 +4,10 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef _XBT_WIN32
-#include <unistd.h>
-#endif
-
 #include "simgrid/msg.h"
 #include "xbt/graph.h"
 
 #include "simgrid/msg.h"
 #include "xbt/graph.h"
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(graphicator,
-                             "Graphicator Logging System");
+XBT_LOG_NEW_DEFAULT_CATEGORY(graphicator, "Graphicator Logging System");
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {