From 1759e32c7bb71a8b13611fcd7e5dfec535da8c98 Mon Sep 17 00:00:00 2001 From: Lucas Terra Date: Mon, 18 Apr 2016 16:15:37 -0300 Subject: [PATCH] Conditionally define snprintf on Windows snprintf is already defined in MSVC 2015. If you redefine it will cry about it and abort the compilation. --- lib/libwebsockets.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 5265dc9e..4824dc2a 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -146,7 +146,9 @@ struct sockaddr_in; #define LWS_INVALID_FILE INVALID_HANDLE_VALUE #define LWS_O_RDONLY _O_RDONLY +#if !defined(_MSC_VER) || _MSC_VER < 1900 /* Visual Studio 2015 already defines this in */ #define snprintf _snprintf +#endif #else /* NOT WIN32 */ #include