X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4548f56df597a23f4f0510d698c08589e5265ce7..ef0988cf8eb71517681c60a18a417f185bd602c4:/src/win32/compiler/visualc.h diff --git a/src/win32/compiler/visualc.h b/src/win32/compiler/visualc.h index adb89054dc..0bc76eaf49 100644 --- a/src/win32/compiler/visualc.h +++ b/src/win32/compiler/visualc.h @@ -164,11 +164,31 @@ #undef HAVE_SIGNAL #endif +/* "disable the snprintf replacement ( this function is broken on system v only" */ + + + +#ifdef PREFER_PORTABLE_SNPRINTF +# undef PREFER_PORTABLE_SNPRINTF 1 +#endif + + /* The compiler has `snprintf' function. */ -#ifndef HAVE_SNPRINTF - #define HAVE_SNPRINTF 1 +#if _MSC_VER >= 1400 +# ifndef HAVE_SNPRINTF +# define HAVE_SNPRINTF 1 +# ifndef PREFER_PORTABLE_SNPRINTF +# define snprintf _snprintf +# endif +# endif +#else +# ifdef HAVE_SNPRINTF + #undef HAVE_SNPRINTF +# endif #endif + + /* No `swapcontext' function. */ #if defined(HAVE_SWAPCONTEXT) #undef HAVE_SWAPCONTEXT @@ -201,13 +221,6 @@ #define NEED_VASPRINTF #endif -/* "disable the snprintf replacement ( this function is broken on system v only" */ - - -#if !defined(PREFER_PORTABLE_SNPRINTF) - #define PREFER_PORTABLE_SNPRINTF -#endif - /* The maximal size of any scalar on this arch */ #if !defined(SIZEOF_MAX) #define SIZEOF_MAX 8 @@ -386,8 +399,6 @@ the double. For now, GRAS requires the structures to be compacted. */ * Replace winsock2.h,ws2tcpip.h and winsock.h header files */ #include -/* types */ -typedef unsigned int uint32_t; /* Choose setjmp as exception implementation */ #ifndef __EX_MCTX_SJLJ__ @@ -395,6 +406,28 @@ typedef unsigned int uint32_t; #endif + +#include + +#define S_IWUSR _S_IWRITE +#define S_IRUSR _S_IREAD + +#ifdef _WIN32_WINNT + #if _WIN32_WINNT < 0x0400 + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0400 + #endif +#else + #define _WIN32_WINNT 0x0400 +#endif + +/* Visual C++ does not declare the ssize_t type */ typedef int ssize_t; +/* Visual C++ does not declare the mode_t type */ +typedef unsigned int mode_t; + +/* Visual C++ does not declare the uint32_t type */ +typedef unsigned int uint32_t; + #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */