(svn r11744) -Codechange: don't redefine snprintf when using MinGW Runtime 3.14 or superior, as it now have snprintf() and vsnprintf conform to C99
authorglx
Wed, 02 Jan 2008 18:42:51 +0000
changeset 8181 9c6a2d52e136
parent 8180 df1ff9450ec9
child 8182 e5edf1b01be8
(svn r11744) -Codechange: don't redefine snprintf when using MinGW Runtime 3.14 or superior, as it now have snprintf() and vsnprintf conform to C99
src/string.cpp
--- a/src/string.cpp	Tue Jan 01 22:39:11 2008 +0000
+++ b/src/string.cpp	Wed Jan 02 18:42:51 2008 +0000
@@ -153,6 +153,8 @@
 }
 
 #ifdef WIN32
+/* Since version 3.14, MinGW Runtime has snprintf() and vsnprintf() conform to C99 but it's not the case for older versions */
+#if (__MINGW32_MAJOR_VERSION < 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 14))
 int CDECL snprintf(char *str, size_t size, const char *format, ...)
 {
 	va_list ap;
@@ -163,6 +165,7 @@
 	va_end(ap);
 	return ret;
 }
+#endif /* MinGW Runtime < 3.14 */
 
 #ifdef _MSC_VER
 /* *nprintf broken, not POSIX compliant, MSDN description