summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-01-02 18:42:51 +0000
committerglx <glx@openttd.org>2008-01-02 18:42:51 +0000
commit3265ed1b7009d237933c4e1d3a26f8c513182f22 (patch)
tree7ebef26929934840e9334d6b5736b2c6998d0d32 /src/string.cpp
parent8e0f02d8408c2018a9f957752c027c377656c024 (diff)
downloadopenttd-3265ed1b7009d237933c4e1d3a26f8c513182f22.tar.xz
(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
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp
index a62fb6d04..056f310de 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -153,6 +153,8 @@ bool IsValidChar(WChar key, CharSetFilter afilter)
}
#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 @@ int CDECL snprintf(char *str, size_t size, const char *format, ...)
va_end(ap);
return ret;
}
+#endif /* MinGW Runtime < 3.14 */
#ifdef _MSC_VER
/* *nprintf broken, not POSIX compliant, MSDN description