Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use snprintf of Visual C++
[simgrid.git] / src / win32 / compiler / visualc.h
index 699003d..cb19849 100644 (file)
        #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. */
-#if defined(HAVE_SNPRINTF)
-       #undef 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
 #endif
 
 /* The compiler has the `vsnprintf' function. */
-/*#if !defined(HAVE_VSNPRINTF)
+#ifndef HAVE_VSNPRINTF
        #define HAVE_VSNPRINTF  1
-#endif*/
-
-
-/* enable the asprintf replacement */
-#if !defined(NEED_ASPRINTF)
-       #define NEED_ASPRINTF   1
 #endif
 
-/*#ifdef NEED_ASPRINTF
-#undef NEED_ASPRINTF
-#endif*/
-
 
-/* enable the vasprintf replacement */
-#if  !defined(NEED_VASPRINTF)
-       #define NEED_VASPRINTF  1
+/* disable the asprintf replacement */
+#ifndef NEED_ASPRINTF
+       #define NEED_ASPRINTF   
 #endif
 
-/* "disable the snprintf replacement ( this function is broken on system v only" */
-
-/* FIXME TO ANALYZE */
-#if defined(PREFER_PORTABLE_SNPRINTF)
-       #undef PREFER_PORTABLE_SNPRINTF 
-#endif
 
-#if !defined(PREFER_PORTABLE_SNPRINTF)
-       #define PREFER_PORTABLE_SNPRINTF        
+/* disable the vasprintf replacement */
+#ifndef NEED_VASPRINTF
+       #define NEED_VASPRINTF
 #endif
 
 /* The maximal size of any scalar on this arch */
@@ -396,7 +401,6 @@ the double. For now, GRAS requires the structures to be compacted. */
 
 /* types */
 typedef unsigned int uint32_t;
-typedef int socklen_t;
 
 /* Choose setjmp as exception implementation */
 #ifndef __EX_MCTX_SJLJ__
@@ -404,6 +408,6 @@ typedef int socklen_t;
 #endif 
 
 
-
+typedef int ssize_t;
 
 #endif /* #ifndef __XBT_VISUALC_COMPILER_CONFIG_H__ */