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:
parent
e49ebd696e
commit
4a7c1268e0
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user