Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use snprintf of Visual C++
[simgrid.git] / src / win32 / compiler / visualc.h
index 3833296..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 _MSC_VER >= 7 /* FIXME: check version number */
+#if _MSC_VER >= 1400 
 #  ifndef HAVE_SNPRINTF
-       #define HAVE_SNPRINTF   1
+#    define HAVE_SNPRINTF      1
+#    ifndef PREFER_PORTABLE_SNPRINTF
+#      define snprintf _snprintf
+#    endif
 #  endif
 #else 
 #  ifdef HAVE_SNPRINTF
 #  endif
 #endif
 
+
+
 /* No `swapcontext' function. */
 #if defined(HAVE_SWAPCONTEXT)
        #undef HAVE_SWAPCONTEXT
        #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