windows: MSVC 2015 has snprintf()

Prior to MSVC 2015, there was no standard compliant snprintf(), added a
compiler version check and disabled the snprintf() replacement for MSVC >=
2015 in test/task.h.

PR-URL: https://github.com/libuv/libuv/pull/341
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Rui Abreu Ferreira 2015-05-03 13:19:50 +01:00 committed by Saúl Ibarra Corretgé
parent a6fa3ca99a
commit 18b857b9bd

View File

@ -184,7 +184,8 @@ enum test_status {
# define inline __inline
# endif
/* Emulate snprintf() on Windows, _snprintf() doesn't zero-terminate the buffer
# if defined(_MSC_VER) && _MSC_VER < 1900
/* Emulate snprintf() on MSVC<2015, _snprintf() doesn't zero-terminate the buffer
* on overflow...
*/
inline int snprintf(char* buf, size_t len, const char* fmt, ...) {
@ -205,6 +206,7 @@ inline int snprintf(char* buf, size_t len, const char* fmt, ...) {
return n;
}
# endif
#endif