windows: define snprintf replacement as inline instead of static

The MSVC compiler does not accept static methods defined in headers,
when linking against a shared library. The snprintf replacement
function used for windows, is now an inline function.

PR-URL: https://github.com/libuv/libuv/pull/329
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Rui Abreu Ferreira 2015-04-22 19:17:31 +01:00 committed by Saúl Ibarra Corretgé
parent e49ebd696e
commit 4a7c1268e0

View File

@ -179,10 +179,15 @@ enum test_status {
#include <stdarg.h>
/* Define inline for MSVC */
# ifdef _MSC_VER
# define inline __inline
# endif
/* Emulate snprintf() on Windows, _snprintf() doesn't zero-terminate the buffer
* on overflow...
*/
static int snprintf(char* buf, size_t len, const char* fmt, ...) {
inline int snprintf(char* buf, size_t len, const char* fmt, ...) {
va_list ap;
int n;