Added VS2008 compatibility (vsnprintf_s uses 4 args by C11 standard, which is supported in VS2010 but not VS2008)

This commit is contained in:
NovaRain
2016-11-03 14:56:32 +08:00
parent 502897cb6f
commit d276da3d68
+5 -1
View File
@@ -46,7 +46,11 @@ void dlog_f(const char *fmt, int type, ...) {
va_list args;
va_start(args, type);
char buf[4096];
vsnprintf_s(buf, sizeof buf, fmt, args);
#if (_MSC_VER < 1600)
vsnprintf_s(buf, sizeof buf, _TRUNCATE, fmt, args);
#else
vsnprintf_s(buf, sizeof buf, fmt, args); // C11 standard
#endif
Log << buf;
Log.flush();
va_end(args);