Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define correctly variables for windows.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 18 Jun 2010 14:26:29 +0000 (14:26 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 18 Jun 2010 14:26:29 +0000 (14:26 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7903 48e7efb5-ca39-0410-a469-dd3cf9ba447f

49 files changed:
CMakeLists.txt
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/MaintainerMode.cmake
buildtools/Cmake/MakeExeLib.cmake
buildtools/Cmake/gras_config.h.in
buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
buildtools/Cmake/test_prog/prog_stacksetup.c
include/simgrid_config.h.in
include/xbt/log.h
include/xbt/misc.h
src/gras/Msg/gras_msg_listener.c
src/gras/Virtu/rl_process.c
src/portable.h
src/simdag/dax_dtd.c
src/simdag/dax_dtd.l
src/simix/smx_context.c
src/simix/smx_context_sysv.c
src/surf/random_mgr.c
src/surf/simgrid_dtd.c
src/surf/simgrid_dtd.l
src/surf/surf.c
src/win32/platform/select_platform_features.h
src/xbt/ex.c
src/xbt/graphxml.c
src/xbt/graphxml.l
src/xbt/log.c
src/xbt/setset.c
src/xbt/xbt_main.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_os_time.c
src/xbt/xbt_rl_synchro.c
teshsuite/simdag/platforms/flatifier.c
tools/gras/stub_generator.c
tools/gras/unix_stub_generator.c
tools/gras/windows_stub_generator.c
tools/tesh2/include/def.h
tools/tesh2/include/types.h
tools/tesh2/include/xsignal.h
tools/tesh2/src/command.c
tools/tesh2/src/context.c
tools/tesh2/src/fstream.c
tools/tesh2/src/getpath.c
tools/tesh2/src/main.c
tools/tesh2/src/reader.c
tools/tesh2/src/runner.c
tools/tesh2/src/writer.c
tools/tesh2/src/xerrno.c
tools/tesh2/src/xsignal.c

index c375a7c..eb72ca5 100644 (file)
@@ -24,6 +24,15 @@ if(EXISTS /usr/include/)
        set(INCLUDES "${INCLUDES} -I/usr/include/")
 endif(EXISTS /usr/include/)
 
        set(INCLUDES "${INCLUDES} -I/usr/include/")
 endif(EXISTS /usr/include/)
 
+### Check 32bits or 64bits
+INCLUDE (CheckTypeSize)
+CHECK_TYPE_SIZE("long" SIZEOF_LONG)
+IF(SIZEOF_LONG EQUAL 4)
+  SET(ARCH_32_BITS 1)
+ELSE(SIZEOF_LONG EQUAL 4)
+  SET(ARCH_32_BITS 0)
+ENDIF(SIZEOF_LONG EQUAL 4)
+
 if(WIN32)
        set(INCLUDES_MORE $ENV{INCLUDE})
        string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
 if(WIN32)
        set(INCLUDES_MORE $ENV{INCLUDE})
        string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
@@ -43,7 +52,20 @@ if(WIN32)
     message("  -- INCLUDES                     ${INCLUDES}\n\n")
     set(__STRICT_ANSI__ 1)
     set(_MSC_VER 1)
     message("  -- INCLUDES                     ${INCLUDES}\n\n")
     set(__STRICT_ANSI__ 1)
     set(_MSC_VER 1)
-    set(_WIN32 1)
+    set(_XBT_WIN32 1)
+    if(BORLAND)                        ### BORLAND COMPILER
+           set(__BORLANDC__ 1)
+           set(_XBT_BORLANDC_COMPILER 1)
+    endif(BORLAND)
+    if(MSVC_VERSION)   ### MicroSoftVisualC COMPILER
+           set(__VISUALC__ 1)
+           set(_XBT_VISUALC_COMPILER 1)
+    endif(MSVC_VERSION)  
+    if(ARCH_32_BITS)   ### Arch 32bits
+       set(_WIN32 1)
+    else(ARCH_32_BITS) ### Arch 64bits
+       set(_WIN64 1)
+    endif(ARCH_32_BITS)
 endif(WIN32)
 
 add_definitions (${INCLUDES})
 endif(WIN32)
 
 add_definitions (${INCLUDES})
index a652958..5cdbd8c 100644 (file)
@@ -36,15 +36,6 @@ SET(VALGRIND_COMMAND "${PROJECT_DIRECTORY}/buildtools/Cmake/my_valgrind.pl")
 SET(MEMORYCHECK_COMMAND "${PROJECT_DIRECTORY}/buildtools/Cmake/my_valgrind.pl")
 #If you use the --read-var-info option Memcheck will run more slowly but may give a more detailed description of any illegal address.
 
 SET(MEMORYCHECK_COMMAND "${PROJECT_DIRECTORY}/buildtools/Cmake/my_valgrind.pl")
 #If you use the --read-var-info option Memcheck will run more slowly but may give a more detailed description of any illegal address.
 
-### Check 32bits or 64bits
-INCLUDE (CheckTypeSize)
-CHECK_TYPE_SIZE("long" SIZEOF_LONG)
-IF(SIZEOF_LONG EQUAL 4)
-  SET(ARCH_32_BITS 1)
-ELSE(SIZEOF_LONG EQUAL 4)
-  SET(ARCH_32_BITS 0)
-ENDIF(SIZEOF_LONG EQUAL 4)
-
 INCLUDE(CTest)
 ENABLE_TESTING()
 
 INCLUDE(CTest)
 ENABLE_TESTING()
 
index 5c6e95a..d585f96 100644 (file)
@@ -481,7 +481,7 @@ if(HAVE_MAKECONTEXT OR WIN32)
        endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
        
        if(WIN32)
        endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
        
        if(WIN32)
-           set(makecontext_CPPFLAGS_2 "-DWIN32 ${INCLUDES}")
+           set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 ${INCLUDES}")
        endif(WIN32)
 
        try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
        endif(WIN32)
 
        try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
index 9fec712..43c5e9f 100644 (file)
@@ -63,19 +63,19 @@ exec_program("${FLEX_EXE} -o src/gras/DataDesc/ddt_parse.yy.c -Pgras_ddt_parse_
 #surf/simgrid_dtd.c: surf/simgrid_dtd.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/surf")
 exec_program("${FLEX_EXE} -o src/surf/simgrid_dtd.c -Psurf_parse_ --noline src/surf/simgrid_dtd.l" "${PROJECT_DIRECTORY}/")
 #surf/simgrid_dtd.c: surf/simgrid_dtd.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/surf")
 exec_program("${FLEX_EXE} -o src/surf/simgrid_dtd.c -Psurf_parse_ --noline src/surf/simgrid_dtd.l" "${PROJECT_DIRECTORY}/")
-set(CHAINE "'s/#include <unistd.h>/#if defined(_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' -i src/surf/simgrid_dtd.c") 
+set(CHAINE "'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' -i src/surf/simgrid_dtd.c")     
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 #xbt/graphxml.c: xbt/graphxml.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/xbt")
 exec_program("${FLEX_EXE} -o src/xbt/graphxml.c -Pxbt_graph_parse_ --noline src/xbt/graphxml.l" "${PROJECT_DIRECTORY}")
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 #xbt/graphxml.c: xbt/graphxml.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/xbt")
 exec_program("${FLEX_EXE} -o src/xbt/graphxml.c -Pxbt_graph_parse_ --noline src/xbt/graphxml.l" "${PROJECT_DIRECTORY}")
-set(CHAINE "'s/#include <unistd.h>/#if defined(_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' -i src/xbt/graphxml.c")                     
+set(CHAINE "'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' -i src/xbt/graphxml.c")                 
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 #simdag/dax_dtd.c: simdag/dax_dtd.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/simdag")
 exec_program("${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l" "${PROJECT_DIRECTORY}")
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 #simdag/dax_dtd.c: simdag/dax_dtd.l
 exec_program("${CMAKE_COMMAND} -E make_directory ${PROJECT_DIRECTORY}/src/simdag")
 exec_program("${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l" "${PROJECT_DIRECTORY}")
-set(CHAINE "'s/#include <unistd.h>/#if defined(_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' -i src/simdag/dax_dtd.c")   
+set(CHAINE "'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' -i src/simdag/dax_dtd.c")       
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 elseif(HAVE_FLEXML AND HAVE_FLEX  AND SED_EXE)
 exec_program("${SED_EXE} ${CHAINE}" "${PROJECT_DIRECTORY}")
 
 elseif(HAVE_FLEXML AND HAVE_FLEX  AND SED_EXE)
index 9599930..338ff0f 100644 (file)
@@ -1,10 +1,10 @@
 ### Make Libs
 if(WIN32)
   foreach(file ${simgrid_sources})
 ### Make Libs
 if(WIN32)
   foreach(file ${simgrid_sources})
-    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT")
+    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_EXPORT")
   endforeach(file ${simgrid_sources})
   foreach(file ${gras_sources})
   endforeach(file ${simgrid_sources})
   foreach(file ${gras_sources})
-    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT")
+    set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_EXPORT")
   endforeach(file ${gras_sources})
 endif(WIN32)
 
   endforeach(file ${gras_sources})
 endif(WIN32)
 
index 4cdeafd..7902f1b 100644 (file)
@@ -2,21 +2,26 @@
 // With Cmake it creates <root>/src/gras_config.h
 
 /* Set somes variables for Windows compilation */
 // With Cmake it creates <root>/src/gras_config.h
 
 /* Set somes variables for Windows compilation */
+
+#ifdef _XBT_DLL_EXPORT
+       #define DLL_EXPORT
+#else
+       #define DLL_IMPORT
+#endif
+
 #ifndef __STRICT_ANSI__
        #cmakedefine __STRICT_ANSI__ @__STRICT_ANSI__@
 #endif
 #ifndef _MSC_VER
        #cmakedefine _MSC_VER @_MSC_VER@
 #endif
 #ifndef __STRICT_ANSI__
        #cmakedefine __STRICT_ANSI__ @__STRICT_ANSI__@
 #endif
 #ifndef _MSC_VER
        #cmakedefine _MSC_VER @_MSC_VER@
 #endif
-#ifndef _WIN32
-       #cmakedefine _WIN32 @_WIN32@
-#endif
-#ifndef WIN32
-       #cmakedefine WIN32 @WIN32@
-#endif
-#ifdef _WIN32
-       #define __VISUALC__
-#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 __VISUALC__ @__VISUALC__@
+#cmakedefine __BORLANDC__ @__BORLANDC__@
+#cmakedefine _XBT_VISUALC_COMPILER @_XBT_VISUALC_COMPILER@
+#cmakedefine _XBT_BORLANDC_COMPILER @_XBT_BORLANDC_COMPILER@
 
 /* Set to true if enable_model-checking is true */
 #cmakedefine MMALLOC_WANT_OVERIDE_LEGACY @MMALLOC_WANT_OVERIDE_LEGACY@
 
 /* Set to true if enable_model-checking is true */
 #cmakedefine MMALLOC_WANT_OVERIDE_LEGACY @MMALLOC_WANT_OVERIDE_LEGACY@
index 589c3fe..a0a7337 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 #include <win32_ucontext.h>
 #else
 #include <ucontext.h>
 #include <win32_ucontext.h>
 #else
 #include <ucontext.h>
index b5f7706..55936ed 100644 (file)
@@ -8,7 +8,7 @@
 #define _XOPEN_SOURCE
 #endif
 
 #define _XOPEN_SOURCE
 #endif
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
        #include "win32_ucontext.h"
        #include "win32_ucontext.c"
 #endif
        #include "win32_ucontext.h"
        #include "win32_ucontext.c"
 #endif
index 35e54e4..8985e0f 100644 (file)
@@ -8,7 +8,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/misc.h"           /* XBT_PUBLIC */
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/misc.h"           /* XBT_PUBLIC */
-#ifndef DLL_EXPORT
+
+#ifdef _XBT_DLL_EXPORT
+       #define DLL_EXPORT
+#else
        #define DLL_IMPORT
 #endif
 
        #define DLL_IMPORT
 #endif
 
index 77f036b..09f539f 100644 (file)
@@ -241,7 +241,7 @@ XBT_PUBLIC(void) xbt_log_control_set(const char *cs);
 /*
  * Do NOT access any members of this structure directly. FIXME: move to private?
  */
 /*
  * Do NOT access any members of this structure directly. FIXME: move to private?
  */
-#ifdef WIN32
+#ifdef _XBT_WIN32
 #define XBT_LOG_BUFF_SIZE  16384        /* Size of the static string in which we build the log string */
 #else
 #define XBT_LOG_BUFF_SIZE 2048  /* Size of the static string in which we build the log string */
 #define XBT_LOG_BUFF_SIZE  16384        /* Size of the static string in which we build the log string */
 #else
 #define XBT_LOG_BUFF_SIZE 2048  /* Size of the static string in which we build the log string */
@@ -266,7 +266,7 @@ XBT_PUBLIC(void) xbt_log_control_set(const char *cs);
        int lineNum;
        va_list ap;
        va_list ap_copy;         /* need a copy to launch dynamic layouts when the static ones overflowed */
        int lineNum;
        va_list ap;
        va_list ap_copy;         /* need a copy to launch dynamic layouts when the static ones overflowed */
-#ifdef WIN32
+#ifdef _XBT_WIN32
        char *buffer;
 #else
        char buffer[XBT_LOG_BUFF_SIZE];
        char *buffer;
 #else
        char buffer[XBT_LOG_BUFF_SIZE];
@@ -389,7 +389,7 @@ XBT_PUBLIC_DATA(s_xbt_log_category_t) _XBT_LOGV(XBT_LOG_ROOT_CAT);
  * code. 
  * Setting the LogEvent's valist member is done inside _log_logEvent.
  */
  * code. 
  * Setting the LogEvent's valist member is done inside _log_logEvent.
  */
-#ifdef WIN32
+#ifdef _XBT_WIN32
 #define _XBT_LOG_PRE(catv, priority) do {                       \
      if (_XBT_LOG_ISENABLEDV(catv, priority)) {                  \
          s_xbt_log_event_t _log_ev =                             \
 #define _XBT_LOG_PRE(catv, priority) do {                       \
      if (_XBT_LOG_ISENABLEDV(catv, priority)) {                  \
          s_xbt_log_event_t _log_ev =                             \
index be067f9..7a5ea89 100644 (file)
@@ -81,7 +81,7 @@
  * Function calling convention (not used for now) 
  */
 
  * Function calling convention (not used for now) 
  */
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 #  ifndef _XBT_CALL
 #    define _XBT_CALL __cdecl
 #   endif
 #  ifndef _XBT_CALL
 #    define _XBT_CALL __cdecl
 #   endif
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
-#elif (defined(_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
+#elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
 #  define XBT_PUBLIC(type)             __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)   type
 #  define XBT_IMPORT_NO_EXPORT(type)   __declspec(dllimport) type
 #  define XBT_PUBLIC(type)             __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)   type
 #  define XBT_IMPORT_NO_EXPORT(type)   __declspec(dllimport) type
index 5d8ef35..9805950 100644 (file)
@@ -57,7 +57,7 @@ static void listener_function(void *p)
         int sock;
         xbt_queue_shift_timed(me->socks_to_close, &sock, 0);
         if (tcp_close(sock) < 0) {
         int sock;
         xbt_queue_shift_timed(me->socks_to_close, &sock, 0);
         if (tcp_close(sock) < 0) {
-#ifdef _WIN32
+#ifdef _XBT_WIN32
           WARN2("error while closing tcp socket %d: %d (%s)\n", sock, sock_errno);
 #else
           WARN3("error while closing tcp socket %d: %d (%s)\n",
           WARN2("error while closing tcp socket %d: %d (%s)\n", sock, sock_errno);
 #else
           WARN3("error while closing tcp socket %d: %d (%s)\n",
index e863eb3..a2ba1a4 100644 (file)
@@ -23,7 +23,7 @@ XBT_EXPORT_NO_IMPORT(char const *) _gras_procname = NULL;
        # include <crt_externs.h>
        # define environ (*_NSGetEnviron())
 # else
        # include <crt_externs.h>
        # define environ (*_NSGetEnviron())
 # else
-       #ifdef WIN32
+       #ifdef _XBT_WIN32
                 /* the environment, as specified by the opengroup, used to initialize the process properties */
                 extern char **wenviron;
        #else
                 /* the environment, as specified by the opengroup, used to initialize the process properties */
                 extern char **wenviron;
        #else
@@ -74,7 +74,7 @@ const char *xbt_procname(void)
 
 int gras_os_getpid(void)
 {
 
 int gras_os_getpid(void)
 {
-#ifdef _WIN32
+#ifdef _XBT_WIN32
   return (long int) GetCurrentProcessId();
 #else
   return (long int) getpid();
   return (long int) GetCurrentProcessId();
 #else
   return (long int) getpid();
index 7a71ee0..76e6f7b 100644 (file)
@@ -13,9 +13,9 @@
 #include "simgrid_config.h"
 #include "xbt/misc.h"
 /* 
 #include "simgrid_config.h"
 #include "xbt/misc.h"
 /* 
- * win32 or win64 (__WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC).        
+ * win32 or win64 (__XBT_WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC).
 */
 */
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 # include "win32/config.h"
 # include <windows.h>
 #else
 # include "win32/config.h"
 # include <windows.h>
 #else
index a5cc420..c7d5d92 100644 (file)
@@ -1316,7 +1316,7 @@ const char rcs_dax__flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
@@ -1568,7 +1568,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(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index 062341a..0f79b9e 100644 (file)
@@ -61,7 +61,7 @@ const char rcs_dax__flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index 7bc68a7..09c75b0 100644 (file)
@@ -37,7 +37,7 @@ void SIMIX_context_mod_init(void)
 #ifdef CONTEXT_THREADS
     /* context switch based os thread */
     SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
 #ifdef CONTEXT_THREADS
     /* context switch based os thread */
     SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-#elif !defined(WIN32)
+#elif !defined(_XBT_WIN32)
     /* context switch based ucontext */
     SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
 #else
     /* context switch based ucontext */
     SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
 #else
@@ -124,7 +124,7 @@ void SIMIX_context_init_factory_by_name(smx_context_factory_t * factory,
 #endif /* CONTEXT_THREADS */
    
     else if (!strcmp(name, "sysv"))
 #endif /* CONTEXT_THREADS */
    
     else if (!strcmp(name, "sysv"))
-  #if !defined(WIN32) && !defined(CONTEXT_THREADS)
+  #if !defined(_XBT_WIN32) && !defined(CONTEXT_THREADS)
       SIMIX_ctx_sysv_factory_init(factory);
   #else
       THROW0(not_found_error, 0, "Factory 'sysv' does not exist: no System V thread support under Windows");
       SIMIX_ctx_sysv_factory_init(factory);
   #else
       THROW0(not_found_error, 0, "Factory 'sysv' does not exist: no System V thread support under Windows");
index 775db1c..da3dd53 100644 (file)
@@ -14,7 +14,7 @@
 #  include <valgrind/valgrind.h>
 #endif /* HAVE_VALGRIND_VALGRIND_H */
 
 #  include <valgrind/valgrind.h>
 #endif /* HAVE_VALGRIND_VALGRIND_H */
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
        #include "ucontext.h"
        #include "ucontext.c"
 #endif
        #include "ucontext.h"
        #include "ucontext.c"
 #endif
index f098226..ebc698d 100644 (file)
@@ -7,7 +7,7 @@
 #include "surf/random_mgr.h"
 #include "xbt/sysdep.h"
 
 #include "surf/random_mgr.h"
 #include "xbt/sysdep.h"
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 
 static unsigned int _seed = 2147483647;
 
 
 static unsigned int _seed = 2147483647;
 
index c7d66fb..40d97fa 100644 (file)
@@ -2878,7 +2878,7 @@ const char rcs_surfxml_flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
@@ -3256,7 +3256,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(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index 806031f..1e20dc3 100644 (file)
@@ -61,7 +61,7 @@ const char rcs_surfxml_flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index 427af07..0245079 100644 (file)
@@ -19,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
 #define MAX_DRIVE 26
 #endif
 
 #define MAX_DRIVE 26
 #endif
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 #include <windows.h>
 static const char *disk_drives_letter_table[MAX_DRIVE] = {
   "A:\\",
 #include <windows.h>
 static const char *disk_drives_letter_table[MAX_DRIVE] = {
   "A:\\",
@@ -49,7 +49,7 @@ static const char *disk_drives_letter_table[MAX_DRIVE] = {
   "Y:\\",
   "Z:\\"
 };
   "Y:\\",
   "Z:\\"
 };
-#endif /* #ifdef _WIN32 */
+#endif /* #ifdef _XBT_WIN32 */
 
 /*
  * Returns the initial path. On Windows the initial path is
 
 /*
  * Returns the initial path. On Windows the initial path is
@@ -61,7 +61,7 @@ static const char *disk_drives_letter_table[MAX_DRIVE] = {
 const char *__surf_get_initial_path(void)
 {
 
 const char *__surf_get_initial_path(void)
 {
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
   unsigned i;
   char current_directory[MAX_PATH + 1] = { 0 };
   unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
   unsigned i;
   char current_directory[MAX_PATH + 1] = { 0 };
   unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
@@ -89,7 +89,7 @@ const char *__surf_get_initial_path(void)
  */
 int __surf_is_absolute_file_path(const char *file_path)
 {
  */
 int __surf_is_absolute_file_path(const char *file_path)
 {
-#ifdef _WIN32
+#ifdef _XBT_WIN32
   WIN32_FIND_DATA wfd = { 0 };
   HANDLE hFile = FindFirstFile(file_path, &wfd);
 
   WIN32_FIND_DATA wfd = { 0 };
   HANDLE hFile = FindFirstFile(file_path, &wfd);
 
@@ -285,7 +285,7 @@ void surf_init(int *argc, char **argv)
 #endif
 }
 
 #endif
 }
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 # define FILE_DELIM "\\"
 #else
 # define FILE_DELIM "/"         /* FIXME: move to better location */
 # define FILE_DELIM "\\"
 #else
 # define FILE_DELIM "/"         /* FIXME: move to better location */
index 92830d7..93f5366 100644 (file)
@@ -14,7 +14,7 @@
 
 
 /* 
 
 
 /* 
- * win32 or win64 (__WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC).        
+ * win32 or win64 (__XBT_WIN32 is defined for win32 and win64 applications, __TOS_WIN__ is defined by xlC).
 */ 
 
 /* If the platform is not resolved _XBT_PLATFORM_ID is set to zero. */
 */ 
 
 /* If the platform is not resolved _XBT_PLATFORM_ID is set to zero. */
@@ -69,8 +69,8 @@
 #endif
 
 #if defined(_XBT_WIN32_PLATFORM) || defined(_XBT_WIN64_PLATFORM) || defined(_XBT_WIN16_PLATFORM) || defined(_XBT_WINCE_PLATFORM)
 #endif
 
 #if defined(_XBT_WIN32_PLATFORM) || defined(_XBT_WIN64_PLATFORM) || defined(_XBT_WIN16_PLATFORM) || defined(_XBT_WINCE_PLATFORM)
-#ifndef _WIN32
-       #define _WIN32
+#ifndef _XBT_WIN32
+       #define _XBT_WIN32
 #endif
 #endif
 
 #endif
 #endif
 
 
 
 
 
 
 
-#endif /* #define __XBT_SELECT_PLATFORM_FEATURES_H__ */
\ No newline at end of file
+#endif /* #define __XBT_SELECT_PLATFORM_FEATURES_H__ */
index 5eae5fc..a3c5a8b 100644 (file)
@@ -58,7 +58,7 @@
 # define HAVE_BACKTRACE 1       /* Hello linux box */
 #endif
 
 # define HAVE_BACKTRACE 1       /* Hello linux box */
 #endif
 
-#if defined(WIN32) && defined(_M_IX86) && !defined(__GNUC__)
+#if defined(_XBT_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
 # define HAVE_BACKTRACE 1       /* Hello x86 windows box */
 #endif
 
 # define HAVE_BACKTRACE 1       /* Hello x86 windows box */
 #endif
 
@@ -122,7 +122,7 @@ void xbt_backtrace_display_current(void)
 
 #if defined(HAVE_EXECINFO_H) && defined(HAVE_POPEN) && defined(ADDR2LINE)
 # include "backtrace_linux.c"
 
 #if defined(HAVE_EXECINFO_H) && defined(HAVE_POPEN) && defined(ADDR2LINE)
 # include "backtrace_linux.c"
-#elif (defined(WIN32) && defined (_M_IX86)) && !defined(__GNUC__)
+#elif (defined(_XBT_WIN32) && defined (_M_IX86)) && !defined(__GNUC__)
 # include "backtrace_windows.c"
 #else
 # include "backtrace_dummy.c"
 # include "backtrace_windows.c"
 #else
 # include "backtrace_dummy.c"
index 1da5976..a85b673 100644 (file)
@@ -1114,7 +1114,7 @@ const char rcs_graphxml_flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
@@ -1332,7 +1332,7 @@ const char* *graphxml_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(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index d556525..5c3becc 100644 (file)
@@ -61,7 +61,7 @@ const char rcs_graphxml_flexml[] =
 #include <stdarg.h>
 #include <ctype.h>
      
 #include <stdarg.h>
 #include <ctype.h>
      
-#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
+#if defined(_XBT_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>
index 269c7c0..bcd94e9 100644 (file)
@@ -621,7 +621,7 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
   va_end(ev->ap);
   va_end(ev->ap_copy);
 
   va_end(ev->ap);
   va_end(ev->ap_copy);
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
   free(ev->buffer);
 #endif
 }
   free(ev->buffer);
 #endif
 }
index d5c33e9..3458182 100644 (file)
@@ -5,7 +5,7 @@
 #include "xbt/sysdep.h"
 
 /*The function ffs doesn't exist for windows*/
 #include "xbt/sysdep.h"
 
 /*The function ffs doesn't exist for windows*/
-#ifdef WIN32
+#ifdef _XBT_WIN32
        int XBT_INLINE ffs(int x)
        {
                int r;
        int XBT_INLINE ffs(int x)
        {
                int r;
index 47bef26..8ce310b 100644 (file)
@@ -57,7 +57,7 @@ static void xbt_postexit(void) _XBT_GNUC_DESTRUCTOR;
 #pragma fini (xbt_postexit)
 #endif
 
 #pragma fini (xbt_postexit)
 #endif
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 #include <windows.h>
 
 /* Dummy prototype to make gcc happy */
 #include <windows.h>
 
 /* Dummy prototype to make gcc happy */
index c2768de..8b99b27 100644 (file)
@@ -576,7 +576,7 @@ void xbt_os_sem_get_value(xbt_os_sem_t sem, int *svalue)
 
 /* ********************************* WINDOWS IMPLEMENTATION ************************************ */
 
 
 /* ********************************* WINDOWS IMPLEMENTATION ************************************ */
 
-#elif defined(WIN32)
+#elif defined(_XBT_WIN32)
 
 #include <math.h>
 
 
 #include <math.h>
 
index 0345e0f..19624a5 100644 (file)
@@ -13,7 +13,7 @@
 #include <math.h>               /* floor */
 
 
 #include <math.h>               /* floor */
 
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 #include <sys/timeb.h>
 #endif
 
 #include <sys/timeb.h>
 #endif
 
@@ -22,7 +22,7 @@ double xbt_os_time(void)
 #ifdef HAVE_GETTIMEOFDAY
   struct timeval tv;
   gettimeofday(&tv, NULL);
 #ifdef HAVE_GETTIMEOFDAY
   struct timeval tv;
   gettimeofday(&tv, NULL);
-#elif defined(WIN32)
+#elif defined(_XBT_WIN32)
   struct timeval tv;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   struct _timeb tm;
   struct timeval tv;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   struct _timeb tm;
@@ -59,7 +59,7 @@ void xbt_os_sleep(double sec)
   sleep(sec);
   (void) usleep((sec - floor(sec)) * 1000000);
 
   sleep(sec);
   (void) usleep((sec - floor(sec)) * 1000000);
 
-#elif WIN32
+#elif _XBT_WIN32
   Sleep((floor(sec) * 1000) + ((sec - floor(sec)) * 1000));
 
 #else /* don't have usleep. Use select to sleep less than one second */
   Sleep((floor(sec) * 1000) + ((sec - floor(sec)) * 1000));
 
 #else /* don't have usleep. Use select to sleep less than one second */
index 0bdbba6..aee53fb 100644 (file)
@@ -93,7 +93,7 @@ struct xbt_mutex_ {
   /* KEEP IT IN SYNC WITH OS IMPLEMENTATION (both win and lin) */
 #ifdef HAVE_PTHREAD_H
   pthread_mutex_t m;
   /* KEEP IT IN SYNC WITH OS IMPLEMENTATION (both win and lin) */
 #ifdef HAVE_PTHREAD_H
   pthread_mutex_t m;
-#elif defined(WIN32)
+#elif defined(_XBT_WIN32)
   CRITICAL_SECTION lock;
 #endif
 };
   CRITICAL_SECTION lock;
 #endif
 };
@@ -129,7 +129,7 @@ void xbt_mutex_destroy(xbt_mutex_t mutex)
   xbt_os_mutex_destroy((xbt_os_mutex_t) mutex);
 }
 
   xbt_os_mutex_destroy((xbt_os_mutex_t) mutex);
 }
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 enum {                          /* KEEP IT IN SYNC WITH OS IMPLEM */
   SIGNAL = 0,
   BROADCAST = 1,
 enum {                          /* KEEP IT IN SYNC WITH OS IMPLEM */
   SIGNAL = 0,
   BROADCAST = 1,
@@ -142,7 +142,7 @@ typedef struct xbt_cond_ {
   /* KEEP IT IN SYNC WITH OS IMPLEMENTATION (both win and lin) */
 #ifdef HAVE_PTHREAD_H
   pthread_cond_t c;
   /* KEEP IT IN SYNC WITH OS IMPLEMENTATION (both win and lin) */
 #ifdef HAVE_PTHREAD_H
   pthread_cond_t c;
-#elif defined(WIN32)
+#elif defined(_XBT_WIN32)
   HANDLE events[MAX_EVENTS];
 
   unsigned int waiters_count;   /* the number of waiters                        */
   HANDLE events[MAX_EVENTS];
 
   unsigned int waiters_count;   /* the number of waiters                        */
index 603a568..86f2941 100644 (file)
@@ -4,7 +4,7 @@
 /* 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 WIN32
+#ifndef _XBT_WIN32
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
index 5dade2a..a94dec9 100644 (file)
@@ -27,7 +27,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
 
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 #include <windows.h>
 #endif
 
 #include <windows.h>
 #endif
 
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
   generate_sim(project_name);
   generate_rl(project_name);
   generate_makefile_local(project_name, deployment_file);
   generate_sim(project_name);
   generate_rl(project_name);
   generate_makefile_local(project_name, deployment_file);
-#ifdef _WIN32
+#ifdef _XBT_WIN32
   generate_borland_simulation_project(project_name);
   generate_borland_real_life_project(project_name);
   generate_simulation_dsp_file(project_name);
   generate_borland_simulation_project(project_name);
   generate_borland_real_life_project(project_name);
   generate_simulation_dsp_file(project_name);
index b5bc335..5e1733e 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdarg.h>
 
 
 #include <stdarg.h>
 
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 /* stupid stubs so that it compiles on windows */
 void generate_sim(char *project)
 {
 /* stupid stubs so that it compiles on windows */
 void generate_sim(char *project)
 {
index 889a240..d2c46f1 100644 (file)
@@ -29,7 +29,7 @@
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(stubgen);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(stubgen);
 
-#ifdef _WIN32
+#ifdef _XBT_WIN32
 
 char *__gras_path = NULL;
 
 
 char *__gras_path = NULL;
 
@@ -568,7 +568,7 @@ void borland_project_create_main_file(const char *name)
   FILE *stream = fopen(name, "w+");
 
   fprintf(stream,
   FILE *stream = fopen(name, "w+");
 
   fprintf(stream,
-          "Ce fichier est uniquement utilisé par le gestionnaire de projets et doit Ãªtre traité comme le fichier projet\n\n\nmain\n");
+          "Ce fichier est uniquement utilis� par le gestionnaire de projets et doit ï¿½tre trait� comme le fichier projet\n\n\nmain\n");
 
   fclose(stream);
 }
 
   fclose(stream);
 }
@@ -966,12 +966,12 @@ void generate_dsp_project(dsp_t project, int is_rl, const char *name)
   fprintf(project->stream, "# PROP Intermediate_Dir \"Release\"\n");
   fprintf(project->stream, "# PROP Target_Dir \"\"\n");
   /* TODO : the include directory */
   fprintf(project->stream, "# PROP Intermediate_Dir \"Release\"\n");
   fprintf(project->stream, "# PROP Target_Dir \"\"\n");
   /* TODO : the include directory */
-  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /GX /O2 /I \"./%s\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",__gras_path); */
+  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /GX /O2 /I \"./%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",__gras_path); */
   fprintf(project->stream,
   fprintf(project->stream,
-          "# ADD BASE CPP /nologo /W3 /GX /O2 /I \"%s\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",
+          "# ADD BASE CPP /nologo /W3 /GX /O2 /I \"%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n",
           __gras_path);
   fprintf(project->stream,
           __gras_path);
   fprintf(project->stream,
-          "# ADD CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n");
+          "# ADD CPP /nologo /W3 /GX /O2 /D \"_XBT_WIN32\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n");
   fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"NDEBUG\"\n");
   fprintf(project->stream, "# ADD RSC /l 0x40c /d \"NDEBUG\n");
   fprintf(project->stream, "BSC32=bscmake.exe\n");
   fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"NDEBUG\"\n");
   fprintf(project->stream, "# ADD RSC /l 0x40c /d \"NDEBUG\n");
   fprintf(project->stream, "BSC32=bscmake.exe\n");
@@ -1003,12 +1003,12 @@ void generate_dsp_project(dsp_t project, int is_rl, const char *name)
   fprintf(project->stream, "# PROP Ignore_Export_Lib 0\n");
   fprintf(project->stream, "# PROP Target_Dir \"\"\n");
   /* TODO : the include directory */
   fprintf(project->stream, "# PROP Ignore_Export_Lib 0\n");
   fprintf(project->stream, "# PROP Target_Dir \"\"\n");
   /* TODO : the include directory */
-  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"./%s\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",__gras_path); */
+  /*fprintf(project->stream,"# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"./%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",__gras_path); */
   fprintf(project->stream,
   fprintf(project->stream,
-          "# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"%s\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",
+          "# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od  /I \"%s\" /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n",
           __gras_path);
   fprintf(project->stream,
           __gras_path);
   fprintf(project->stream,
-          "# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n");
+          "# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"_XBT_WIN32\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ  /c\n");
   fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"_DEBUG\"\n");
   fprintf(project->stream, "# ADD RSC /l 0x40c /d \"_DEBUG\"\n");
   fprintf(project->stream, "BSC32=bscmake.exe\n");
   fprintf(project->stream, "# ADD BASE RSC /l 0x40c /d \"_DEBUG\"\n");
   fprintf(project->stream, "# ADD RSC /l 0x40c /d \"_DEBUG\"\n");
   fprintf(project->stream, "BSC32=bscmake.exe\n");
index ea3bd26..362448c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DEF_H
 
 #if (defined(__BUILTIN) && !defined(__CHKCMD) && !defined(WARN_DEF_MISMATCH))
 #define __DEF_H
 
 #if (defined(__BUILTIN) && !defined(__CHKCMD) && !defined(WARN_DEF_MISMATCH))
-#ifdef WIN32
+#ifdef _XBT_WIN32
 #pragma message(Macro definition mismatch : __BUILTIN defined but __CHKCMD not defined)
 #else
 #warning "Macro definition mismatch : __BUILTIN defined but __CHKCMD not defined"
 #pragma message(Macro definition mismatch : __BUILTIN defined but __CHKCMD not defined)
 #else
 #warning "Macro definition mismatch : __BUILTIN defined but __CHKCMD not defined"
@@ -11,7 +11,7 @@
 #endif
 
 /* must be defined first */
 #endif
 
 /* must be defined first */
-#ifdef WIN32
+#ifdef _XBT_WIN32
 
        #define _WIN32_WINNT    0x0400
        
 
        #define _WIN32_WINNT    0x0400
        
@@ -29,7 +29,7 @@
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
        
        #define strdup                  _strdup
        #define chdir                   _chdir
        
        #define strdup                  _strdup
        #define chdir                   _chdir
index 50d2dee..322d81c 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
  * file descriptor and pid types for portability.
  */
 
  * file descriptor and pid types for portability.
  */
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
        
        #ifndef __FD_T_DEFINED
                typedef HANDLE fd_t;
        
        #ifndef __FD_T_DEFINED
                typedef HANDLE fd_t;
@@ -316,7 +316,7 @@ typedef struct s_context
        output_handling_t output_handling;
        int async;                                                      /* if 1, the command is asynchronous                                                                    */
        
        output_handling_t output_handling;
        int async;                                                      /* if 1, the command is asynchronous                                                                    */
        
-       #ifdef WIN32
+       #ifdef _XBT_WIN32
        char* t_command_line;                           /* translate the command line on Windows                                                                */
        unsigned is_not_found:1;
        #endif
        char* t_command_line;                           /* translate the command line on Windows                                                                */
        unsigned is_not_found:1;
        #endif
@@ -345,7 +345,7 @@ typedef struct s_command
        fd_t stdout_fd;                                         /* the stdout fd of the command                                                                                 */
        fd_t stdin_fd;                                          /* the stdin fd of the command                                                                                  */
        int exit_code;                                          /* the exit code of the command                                                                                 */
        fd_t stdout_fd;                                         /* the stdout fd of the command                                                                                 */
        fd_t stdin_fd;                                          /* the stdin fd of the command                                                                                  */
        int exit_code;                                          /* the exit code of the command                                                                                 */
-       #ifdef WIN32
+       #ifdef _XBT_WIN32
        unsigned long stat_val;
        #else
        int stat_val;
        unsigned long stat_val;
        #else
        int stat_val;
@@ -353,7 +353,7 @@ typedef struct s_command
        char* signal;                                           /* the signal raised by the command if any                                                              */
        xbt_os_mutex_t mutex;
        
        char* signal;                                           /* the signal raised by the command if any                                                              */
        xbt_os_mutex_t mutex;
        
-       #ifndef WIN32
+       #ifndef _XBT_WIN32
        int killed;                                                     /* if 1, the command was killed                                                                                 */
        int execlp_errno;
        #endif
        int killed;                                                     /* if 1, the command was killed                                                                                 */
        int execlp_errno;
        #endif
index b4be02a..d4d42da 100644 (file)
@@ -8,7 +8,7 @@
 extern "C" {\r
 #endif\r
 \r
 extern "C" {\r
 #endif\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 \r
 /* terminal line hangup                                                        */ \r
 #ifndef SIGHUP\r
 \r
 /* terminal line hangup                                                        */ \r
 #ifndef SIGHUP\r
@@ -179,10 +179,10 @@ is_an_unhandled_exception(DWORD exit_code);
  */\r
 #define WTERMSIG(__status)             (__status)\r
 \r
  */\r
 #define WTERMSIG(__status)             (__status)\r
 \r
-#endif /* WIN32 */\r
+#endif /* _XBT_WIN32 */\r
 \r
 \r
 \r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 const char* \r
 signal_name(DWORD got, const char* expected);\r
 #else\r
 const char* \r
 signal_name(DWORD got, const char* expected);\r
 #else\r
index 3f911f6..677979f 100644 (file)
@@ -18,7 +18,7 @@
 #include <reader.h>\r
 #include <timer.h>\r
 \r
 #include <reader.h>\r
 #include <timer.h>\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 #include <sys/types.h>\r
 #include <sys/wait.h>\r
 #include <sys/stat.h>\r
 #include <sys/types.h>\r
 #include <sys/wait.h>\r
 #include <sys/stat.h>\r
@@ -150,7 +150,7 @@ command_new(unit_t unit, context_t context, xbt_os_mutex_t mutex)
        command->root->cmd_nb++;\r
        xbt_os_mutex_release(mutex);\r
 \r
        command->root->cmd_nb++;\r
        xbt_os_mutex_release(mutex);\r
 \r
-       #ifndef WIN32\r
+       #ifndef _XBT_WIN32\r
        command->killed = 0;\r
        command->execlp_errno = 0;\r
        #endif\r
        command->killed = 0;\r
        command->execlp_errno = 0;\r
        #endif\r
@@ -209,7 +209,7 @@ command_start(void* p)
 \r
        /* execute the command of the test */\r
 \r
 \r
        /* execute the command of the test */\r
 \r
-       #ifndef WIN32\r
+       #ifndef _XBT_WIN32\r
        command_exec(command, command->context->command_line);\r
        #else\r
        /* play the translated command line on Windows */\r
        command_exec(command, command->context->command_line);\r
        #else\r
        /* play the translated command line on Windows */\r
@@ -257,7 +257,7 @@ command_start(void* p)
        return NULL;\r
 }\r
 \r
        return NULL;\r
 }\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 \r
 #ifndef BUFSIZE\r
 #define BUFSIZE        4096\r
 \r
 #ifndef BUFSIZE\r
 #define BUFSIZE        4096\r
@@ -666,7 +666,7 @@ command_exec(command_t command, const char* command_line)
 }\r
 #endif\r
 \r
 }\r
 #endif\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 void\r
 command_wait(command_t command)\r
 {\r
 void\r
 command_wait(command_t command)\r
 {\r
@@ -809,7 +809,7 @@ command_check(command_t command)
        while(!command->reader->done)\r
                xbt_os_thread_yield();\r
 \r
        while(!command->reader->done)\r
                xbt_os_thread_yield();\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        CloseHandle(command->stdout_fd);\r
        #else\r
        close(command->stdout_fd);\r
        CloseHandle(command->stdout_fd);\r
        #else\r
        close(command->stdout_fd);\r
@@ -889,7 +889,7 @@ command_check(command_t command)
        }\r
 }\r
 \r
        }\r
 }\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 void\r
 command_kill(command_t command)\r
 {\r
 void\r
 command_kill(command_t command)\r
 {\r
@@ -954,7 +954,7 @@ command_summarize(command_t command)
        if(cs_successeded != command->status)\r
        {\r
 \r
        if(cs_successeded != command->status)\r
        {\r
 \r
-               #ifndef WIN32\r
+               #ifndef _XBT_WIN32\r
                if(command->killed)\r
                        printf("          <killed command>\n");\r
                #endif\r
                if(command->killed)\r
                        printf("          <killed command>\n");\r
                #endif\r
@@ -1177,7 +1177,7 @@ command_free(command_t* ptr)
 {\r
        /* close the stdin and the stdout pipe handles */\r
 \r
 {\r
        /* close the stdin and the stdout pipe handles */\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        if((*ptr)->stdin_fd != INDEFINITE_FD)\r
                CloseHandle((*ptr)->stdin_fd);\r
 \r
        if((*ptr)->stdin_fd != INDEFINITE_FD)\r
                CloseHandle((*ptr)->stdin_fd);\r
 \r
index 3ddd1b2..918e810 100644 (file)
@@ -35,7 +35,7 @@ context_new(void)
        context->output_handling = oh_check;\r
        context->async = 0;\r
 \r
        context->output_handling = oh_check;\r
        context->async = 0;\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        context->t_command_line = NULL;\r
        context->is_not_found = 0;\r
        #endif\r
        context->t_command_line = NULL;\r
        context->is_not_found = 0;\r
        #endif\r
@@ -61,7 +61,7 @@ context_free(context_t* ptr)
        if((*ptr)->signal)\r
                free((*ptr)->signal);\r
 \r
        if((*ptr)->signal)\r
                free((*ptr)->signal);\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        if((*ptr)->t_command_line)\r
                free((*ptr)->t_command_line);\r
        #endif\r
        if((*ptr)->t_command_line)\r
                free((*ptr)->t_command_line);\r
        #endif\r
@@ -83,7 +83,7 @@ context_reset(context_t context)
                context->command_line = NULL;\r
        }\r
 \r
                context->command_line = NULL;\r
        }\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        if(context->t_command_line)\r
        {\r
                free(context->t_command_line);\r
        if(context->t_command_line)\r
        {\r
                free(context->t_command_line);\r
@@ -134,7 +134,7 @@ context_dup(context_t context)
        dup->command_line = strdup(context->command_line);\r
 \r
        \r
        dup->command_line = strdup(context->command_line);\r
 \r
        \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        dup->t_command_line = strdup(context->t_command_line);\r
        dup->is_not_found = context->is_not_found;\r
        #endif\r
        dup->t_command_line = strdup(context->t_command_line);\r
        dup->is_not_found = context->is_not_found;\r
        #endif\r
@@ -186,7 +186,7 @@ context_clear(context_t context)
                context->command_line = NULL;\r
        }\r
 \r
                context->command_line = NULL;\r
        }\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        if(context->t_command_line)\r
        {\r
                free(context->t_command_line);\r
        if(context->t_command_line)\r
        {\r
                free(context->t_command_line);\r
index 313717f..f0e3911 100644 (file)
 #include <is_cmd.h>\r
 #include <getpath.h>\r
 \r
 #include <is_cmd.h>\r
 #include <getpath.h>\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 #include <xsignal.h>\r
 #endif\r
 \r
 #include <xsignal.h>\r
 #endif\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 static int\r
 is_w32_cmd(char* cmd, char** path)\r
 {\r
 static int\r
 is_w32_cmd(char* cmd, char** path)\r
 {\r
@@ -181,7 +181,7 @@ fstream_open(fstream_t fstream)
                return 0;\r
        }\r
        \r
                return 0;\r
        }\r
        \r
-       #ifndef WIN32\r
+       #ifndef _XBT_WIN32\r
        sprintf(path,"%s/%s",fstream->directory, fstream->name);\r
        #else\r
        sprintf(path,"%s\\%s",fstream->directory, fstream->name);\r
        sprintf(path,"%s/%s",fstream->directory, fstream->name);\r
        #else\r
        sprintf(path,"%s\\%s",fstream->directory, fstream->name);\r
@@ -329,14 +329,14 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
                                \r
                        if(context->command_line)\r
                        {\r
                                \r
                        if(context->command_line)\r
                        {\r
-                               #ifdef WIN32\r
+                               #ifdef _XBT_WIN32\r
                                if(!context->is_not_found)\r
                                {\r
                                #endif\r
                                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                                                break;\r
 \r
                                if(!context->is_not_found)\r
                                {\r
                                #endif\r
                                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                                                break;\r
 \r
-                               #ifdef WIN32\r
+                               #ifdef _XBT_WIN32\r
                                }\r
                                #endif\r
                        }\r
                                }\r
                                #endif\r
                        }\r
@@ -384,7 +384,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
        /* Check that last command of the file ran well */\r
        if(context->command_line)\r
        {\r
        /* Check that last command of the file ran well */\r
        if(context->command_line)\r
        {\r
-               #ifdef WIN32\r
+               #ifdef _XBT_WIN32\r
                if(!context->is_not_found)\r
                {\r
                #endif\r
                if(!context->is_not_found)\r
                {\r
                #endif\r
@@ -392,7 +392,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                        return -1;\r
 \r
                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                        return -1;\r
 \r
-               #ifdef WIN32\r
+               #ifdef _XBT_WIN32\r
                }\r
                #endif\r
        }\r
                }\r
                #endif\r
        }\r
@@ -1282,7 +1282,7 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                context->line = /*strdup(filepos)*/ filepos;\r
                context->pos = strdup(filepos);\r
                \r
                context->line = /*strdup(filepos)*/ filepos;\r
                context->pos = strdup(filepos);\r
                \r
-               #ifdef WIN32\r
+               #ifdef _XBT_WIN32\r
                {\r
 \r
                /* translate the command line */\r
                {\r
 \r
                /* translate the command line */\r
@@ -1484,7 +1484,7 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                        \r
                        xbt_str_trim(context->signal," \n");\r
 \r
                        \r
                        xbt_str_trim(context->signal," \n");\r
 \r
-                       #ifdef WIN32\r
+                       #ifdef _XBT_WIN32\r
                        if(!strstr("SIGSEGVSIGTRAPSIGBUSSIGFPESIGILL", context->signal))\r
                        {\r
                                ERROR2("[%s] Signal `%s' not supported by this platform", filepos, context->signal);\r
                        if(!strstr("SIGSEGVSIGTRAPSIGBUSSIGFPESIGILL", context->signal))\r
                        {\r
                                ERROR2("[%s] Signal `%s' not supported by this platform", filepos, context->signal);\r
@@ -1685,7 +1685,7 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                        {\r
                                if(exists)\r
                                {\r
                        {\r
                                if(exists)\r
                                {\r
-                                       #ifndef WIN32\r
+                                       #ifndef _XBT_WIN32\r
                                        unsetenv(name);\r
                                        #else\r
                                        SetEnvironmentVariable(name, NULL);\r
                                        unsetenv(name);\r
                                        #else\r
                                        SetEnvironmentVariable(name, NULL);\r
@@ -1816,7 +1816,7 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                                                free(variable->val);\r
                                                variable->val = strdup(val);\r
 \r
                                                free(variable->val);\r
                                                variable->val = strdup(val);\r
 \r
-                                               #ifdef WIN32\r
+                                               #ifdef _XBT_WIN32\r
                                                SetEnvironmentVariable(variable->name, variable->val);\r
                                                #else\r
                                                setenv(variable->name, variable->val, 1);\r
                                                SetEnvironmentVariable(variable->name, variable->val);\r
                                                #else\r
                                                setenv(variable->name, variable->val, 1);\r
@@ -1853,7 +1853,7 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                                                \r
                                                xbt_dynar_push(unit->runner->variables, &variable);\r
                                                \r
                                                \r
                                                xbt_dynar_push(unit->runner->variables, &variable);\r
                                                \r
-                                               #ifdef WIN32\r
+                                               #ifdef _XBT_WIN32\r
                                                SetEnvironmentVariable(variable->name, variable->val);\r
                                                #else\r
                                                setenv(variable->name, variable->val, 0);\r
                                                SetEnvironmentVariable(variable->name, variable->val);\r
                                                #else\r
                                                setenv(variable->name, variable->val, 0);\r
index ffd9e8c..4f768d7 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(tesh);
 #include <sys/types.h>\r
 #include <sys/stat.h>\r
 \r
 #include <sys/types.h>\r
 #include <sys/stat.h>\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 #include <pwd.h>\r
 #else\r
 #endif\r
 #include <pwd.h>\r
 #else\r
 #endif\r
@@ -22,7 +22,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(tesh);
 #define PATH_MAX 255\r
 #endif\r
 \r
 #define PATH_MAX 255\r
 #endif\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 int\r
 getpath(const char* file, char** path)\r
 {\r
 int\r
 getpath(const char* file, char** path)\r
 {\r
index 3a8e7b9..c169f1e 100644 (file)
@@ -45,7 +45,7 @@ typedef struct s_optentry
 /* logs */
 XBT_LOG_NEW_DEFAULT_CATEGORY(tesh,"TEst SHell utility");
 
 /* logs */
 XBT_LOG_NEW_DEFAULT_CATEGORY(tesh,"TEst SHell utility");
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 /* Windows specific : the previous process error mode                  */
 static UINT 
 prev_error_mode = 0;
 /* Windows specific : the previous process error mode                  */
 static UINT 
 prev_error_mode = 0;
@@ -301,7 +301,7 @@ finalized = 0;
 static int 
 sig_int = 0;
 
 static int 
 sig_int = 0;
 
-#ifdef WIN32
+#ifdef _XBT_WIN32
 static void 
 sig_int_handler(int signum)
 {
 static void 
 sig_int_handler(int signum)
 {
@@ -428,7 +428,7 @@ main(int argc, char* argv[])
        /* then, finalize tesh (release all the allocated memory and exits) */
        finalize();
        
        /* then, finalize tesh (release all the allocated memory and exits) */
        finalize();
        
-       #ifndef WIN32
+       #ifndef _XBT_WIN32
        return exit_code;
        #endif
        
        return exit_code;
        #endif
        
@@ -449,7 +449,7 @@ init(void)
        char* buffer;
        char* suffix = strdup(".tesh");
        
        char* buffer;
        char* suffix = strdup(".tesh");
        
-       #ifdef WIN32
+       #ifdef _XBT_WIN32
        /* Windows specific : don't display the general-protection-fault message box and
         * the the critical-error-handler message box (instead the system send the error
         * to the calling process : tesh)
        /* Windows specific : don't display the general-protection-fault message box and
         * the the critical-error-handler message box (instead the system send the error
         * to the calling process : tesh)
@@ -607,7 +607,7 @@ finalize(void)
                xbt_os_sem_destroy(units_sem);
        
        /* Windows specific (restore the previouse error mode */
                xbt_os_sem_destroy(units_sem);
        
        /* Windows specific (restore the previouse error mode */
-       #ifdef WIN32
+       #ifdef _XBT_WIN32
        SetErrorMode(prev_error_mode);
        #endif
 
        SetErrorMode(prev_error_mode);
        #endif
 
@@ -761,7 +761,7 @@ process_command_line(int argc, char** argv)
                        /* get to the last / (if any) to get the short name of the file */
                        delimiter = strrchr(optarg,'/');
                        
                        /* get to the last / (if any) to get the short name of the file */
                        delimiter = strrchr(optarg,'/');
                        
-                       #ifdef WIN32
+                       #ifdef _XBT_WIN32
                        if(!delimiter)
                                delimiter = strrchr(optarg,'\\');
                        #endif
                        if(!delimiter)
                                delimiter = strrchr(optarg,'\\');
                        #endif
@@ -979,7 +979,7 @@ process_command_line(int argc, char** argv)
                                                        
                                                        delimiter = strrchr(optarg,'/');
 
                                                        
                                                        delimiter = strrchr(optarg,'/');
 
-                                                       #ifdef WIN32
+                                                       #ifdef _XBT_WIN32
                                                        if(!delimiter)
                                                                delimiter = strrchr(optarg,'\\');
                                                        #endif
                                                        if(!delimiter)
                                                                delimiter = strrchr(optarg,'\\');
                                                        #endif
@@ -1064,7 +1064,7 @@ process_command_line(int argc, char** argv)
                        
                                                        delimiter = strrchr(optarg,'/');
 
                        
                                                        delimiter = strrchr(optarg,'/');
 
-                                                       #ifdef WIN32
+                                                       #ifdef _XBT_WIN32
                                                        if(!delimiter)
                                                                delimiter = strrchr(optarg,'\\');
                                                        #endif
                                                        if(!delimiter)
                                                                delimiter = strrchr(optarg,'\\');
                                                        #endif
@@ -1149,7 +1149,7 @@ print_usage(void)
 
        if(!screen_cleaned)
        {
 
        if(!screen_cleaned)
        {
-               #ifdef WIN32
+               #ifdef _XBT_WIN32
                system("cls");
                #else
                system("clear");
                system("cls");
                #else
                system("clear");
@@ -1170,7 +1170,7 @@ print_version(void)
 {
        if(!screen_cleaned)
        {
 {
        if(!screen_cleaned)
        {
-               #ifdef WIN32
+               #ifdef _XBT_WIN32
                system("cls");
                #else
                system("clear");
                system("cls");
                #else
                system("clear");
index ddff421..6aa254a 100644 (file)
@@ -62,7 +62,7 @@ reader_read(reader_t reader)
        reader->thread = xbt_os_thread_create("", reader_start_routine, reader);\r
 }\r
 \r
        reader->thread = xbt_os_thread_create("", reader_start_routine, reader);\r
 }\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 static void*\r
 reader_start_routine(void* p)\r
 {\r
 static void*\r
 reader_start_routine(void* p)\r
 {\r
index 79ccc08..35f0691 100644 (file)
@@ -24,7 +24,7 @@
 #include <readline.h>\r
 #include <explode.h>\r
 \r
 #include <readline.h>\r
 #include <explode.h>\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 #include <sys/resource.h>\r
 #endif\r
 \r
 #include <sys/resource.h>\r
 #endif\r
 \r
@@ -36,7 +36,7 @@
 \r
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(tesh);\r
 \r
 \r
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(tesh);\r
 \r
-#if (!defined(__BUILTIN) && defined(__CHKCMD) && !defined(WIN32))\r
+#if (!defined(__BUILTIN) && defined(__CHKCMD) && !defined(_XBT_WIN32))\r
 static const char* builtin[] =\r
 {\r
        "alias",\r
 static const char* builtin[] =\r
 {\r
        "alias",\r
@@ -92,12 +92,16 @@ static const char* builtin[] =
 /* under darwin, the environment gets added to the process at startup time. So, it's not defined at library link time, forcing us to extra tricks */\r
 # include <crt_externs.h>\r
 # define environ (*_NSGetEnviron())\r
 /* under darwin, the environment gets added to the process at startup time. So, it's not defined at library link time, forcing us to extra tricks */\r
 # include <crt_externs.h>\r
 # define environ (*_NSGetEnviron())\r
-# elif !defined(WIN32)\r
- /* the environment, as specified by the opengroup, used to initialize the process properties */\r
- extern char **environ;\r
+# else\r
+       #ifdef _XBT_WIN32\r
+        /* the environment, as specified by the opengroup, used to initialize the process properties */\r
+               # define environ **wenviron;\r
+       #else\r
+               extern char **environ;\r
+       #endif\r
 # endif\r
 \r
 # endif\r
 \r
-#ifndef WIN32\r
+#ifndef _XBT_WIN32\r
 extern char**\r
 environ;\r
 #endif\r
 extern char**\r
 environ;\r
 #endif\r
@@ -121,7 +125,7 @@ runner_start_routine(void* p);
 /*static void\r
 check_syntax(void);*/\r
 \r
 /*static void\r
 check_syntax(void);*/\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 \r
 static HANDLE \r
 timer_handle = NULL;\r
 \r
 static HANDLE \r
 timer_handle = NULL;\r
@@ -206,7 +210,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
        const char* cstr;\r
        variable_t variable;\r
        \r
        const char* cstr;\r
        variable_t variable;\r
        \r
-       #if (defined(__CHKCMD) && defined(__BUILTIN) && !defined(WIN32))\r
+       #if (defined(__CHKCMD) && defined(__BUILTIN) && !defined(_XBT_WIN32))\r
        FILE* s;\r
        int n = 0;\r
        size_t len;\r
        FILE* s;\r
        int n = 0;\r
        size_t len;\r
@@ -277,7 +281,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
                        variable->env = 1;\r
                        xbt_dynar_push(runner->variables, &variable);\r
                        \r
                        variable->env = 1;\r
                        xbt_dynar_push(runner->variables, &variable);\r
                        \r
-                       #ifndef WIN32\r
+                       #ifndef _XBT_WIN32\r
                        if(!strcmp("PATH", buffer))\r
                        #else\r
                        if(!strcmp("Path", buffer) || !strcmp("PATH", buffer))\r
                        if(!strcmp("PATH", buffer))\r
                        #else\r
                        if(!strcmp("Path", buffer) || !strcmp("PATH", buffer))\r
@@ -288,7 +292,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
                                \r
                                /* get the list of paths */\r
                                \r
                                \r
                                /* get the list of paths */\r
                                \r
-                               #ifdef WIN32\r
+                               #ifdef _XBT_WIN32\r
                                runner->path = explode(';', val);\r
                                #else\r
                                runner->path = explode(':', val);\r
                                runner->path = explode(';', val);\r
                                #else\r
                                runner->path = explode(':', val);\r
@@ -301,7 +305,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
                                \r
                                len = strlen(p);\r
                                \r
                                \r
                                len = strlen(p);\r
                                \r
-                                       #ifndef WIN32\r
+                                       #ifndef _XBT_WIN32\r
                                for(j = len - 1; p[j] == '/' || p[j] == ' '; j--)\r
                                        #else\r
                                        for(j = len - 1; p[j] == '\\' || p[j] == ' '; j--)\r
                                for(j = len - 1; p[j] == '/' || p[j] == ' '; j--)\r
                                        #else\r
                                        for(j = len - 1; p[j] == '\\' || p[j] == ' '; j--)\r
@@ -321,7 +325,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
                \r
                sprintf(buffer,"%d",getpid());\r
                \r
                \r
                sprintf(buffer,"%d",getpid());\r
                \r
-               #ifndef WIN32\r
+               #ifndef _XBT_WIN32\r
                setenv("TESH_PPID", buffer, 0);\r
                setenv("TESH_DIR", tesh_dir, 0);\r
                #else\r
                setenv("TESH_PPID", buffer, 0);\r
                setenv("TESH_DIR", tesh_dir, 0);\r
                #else\r
@@ -378,7 +382,7 @@ runner_init(/*int check_syntax_flag, */int timeout, fstreams_t fstreams)
                check_syntax();\r
        */\r
        \r
                check_syntax();\r
        */\r
        \r
-       #if (!defined(WIN32) && defined(__CHKCMD))\r
+       #if (!defined(_XBT_WIN32) && defined(__CHKCMD))\r
        #if defined(__BUILTIN)\r
        \r
        if(!is_tesh_root)\r
        #if defined(__BUILTIN)\r
        \r
        if(!is_tesh_root)\r
@@ -506,7 +510,7 @@ runner_destroy(void)
        if(runner->variables)\r
                xbt_dynar_free(&runner->variables);\r
        \r
        if(runner->variables)\r
                xbt_dynar_free(&runner->variables);\r
        \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
        CloseHandle(timer_handle);\r
        #endif\r
 \r
        CloseHandle(timer_handle);\r
        #endif\r
 \r
@@ -600,7 +604,7 @@ runner_summarize(void)
        \r
        if(!dry_run_flag)\r
        {\r
        \r
        if(!dry_run_flag)\r
        {\r
-               #ifndef WIN32\r
+               #ifndef _XBT_WIN32\r
                struct rusage r_usage;\r
                #else\r
                FILETIME start_time;\r
                struct rusage r_usage;\r
                #else\r
                FILETIME start_time;\r
@@ -654,7 +658,7 @@ runner_summarize(void)
                \r
                printf(")\n\n");\r
                \r
                \r
                printf(")\n\n");\r
                \r
-               #ifndef WIN32\r
+               #ifndef _XBT_WIN32\r
                if(!getrusage(RUSAGE_SELF, &r_usage))\r
                {\r
                \r
                if(!getrusage(RUSAGE_SELF, &r_usage))\r
                {\r
                \r
index 3755abc..f1f13c5 100644 (file)
@@ -62,7 +62,7 @@ writer_write(writer_t writer)
        writer->thread = xbt_os_thread_create("", writer_start_routine, writer);\r
 }\r
 \r
        writer->thread = xbt_os_thread_create("", writer_start_routine, writer);\r
 }\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 static void*\r
 writer_start_routine(void* p)\r
 {\r
 static void*\r
 writer_start_routine(void* p)\r
 {\r
index 3db98e1..0b8deff 100644 (file)
@@ -351,7 +351,7 @@ entry_t err[] =
 \r
 #include <stdio.h>\r
 \r
 \r
 #include <stdio.h>\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 static char *\r
 w32error_to_string(DWORD errcode) \r
 {\r
 static char *\r
 w32error_to_string(DWORD errcode) \r
 {\r
@@ -391,7 +391,7 @@ error_to_string(int errcode, int kind)
                if(err[i].code == errcode && err[i].kind == kind)\r
                        return err[i].string;\r
 \r
                if(err[i].code == errcode && err[i].kind == kind)\r
                        return err[i].string;\r
 \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
 \r
        /* assume it's a W32 error */\r
        return w32error_to_string((DWORD)errcode);\r
 \r
        /* assume it's a W32 error */\r
        return w32error_to_string((DWORD)errcode);\r
index 9e5a914..3b0755c 100644 (file)
@@ -10,7 +10,7 @@
 \r
 #include <xsignal.h>\r
 \r
 \r
 #include <xsignal.h>\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 int\r
 is_an_unhandled_exception(DWORD exit_code);\r
 \r
 int\r
 is_an_unhandled_exception(DWORD exit_code);\r
 \r
@@ -85,7 +85,7 @@ static const s_signal_entry_t signals[] = {
        {"SIG UNKNOWN"  ,-1}\r
 };\r
 \r
        {"SIG UNKNOWN"  ,-1}\r
 };\r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 const char* signal_name(DWORD got, const char* expected) \r
 #else\r
 const char* signal_name(unsigned int got, char *expected) \r
 const char* signal_name(DWORD got, const char* expected) \r
 #else\r
 const char* signal_name(unsigned int got, char *expected) \r
@@ -93,7 +93,7 @@ const char* signal_name(unsigned int got, char *expected)
 {\r
        int i;\r
        \r
 {\r
        int i;\r
        \r
-       #ifdef WIN32\r
+       #ifdef _XBT_WIN32\r
 \r
        for (i=0; i < MAX_EXECPTION; i++)\r
                if (exceptions[i].value == got)\r
 \r
        for (i=0; i < MAX_EXECPTION; i++)\r
                if (exceptions[i].value == got)\r
@@ -124,7 +124,7 @@ sig_exists(const char* sig_name)
 }\r
 \r
 \r
 }\r
 \r
 \r
-#ifdef WIN32\r
+#ifdef _XBT_WIN32\r
 int\r
 is_an_unhandled_exception(DWORD exit_code)\r
 {\r
 int\r
 is_an_unhandled_exception(DWORD exit_code)\r
 {\r