From 4a7c1268e0543f37c47403689c26297918b39120 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Wed, 22 Apr 2015 19:17:31 +0100 Subject: [PATCH] windows: define snprintf replacement as inline instead of static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- test/task.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/task.h b/test/task.h index 646109e79..ea0503e8f 100644 --- a/test/task.h +++ b/test/task.h @@ -179,10 +179,15 @@ enum test_status { #include +/* 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;