projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6496b2
)
Conditionally define snprintf on Windows
author
Lucas Terra
<lucasterra@users.noreply.github.com>
Mon, 18 Apr 2016 19:15:37 +0000
(16:15 -0300)
committer
Andy Green
<andy@warmcat.com>
Tue, 19 Apr 2016 00:23:13 +0000
(08:23 +0800)
snprintf is already defined in MSVC 2015. If you redefine it <stdio.h> will cry about it and abort the compilation.
lib/libwebsockets.h
patch
|
blob
|
history
diff --git
a/lib/libwebsockets.h
b/lib/libwebsockets.h
index
5265dc9
..
4824dc2
100644
(file)
--- 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 <stdio.h> */
#define snprintf _snprintf
+#endif
#else /* NOT WIN32 */
#include <unistd.h>