From 30592827518d8af36d1e686b48ecbc20b502a993 Mon Sep 17 00:00:00 2001 From: Daniel Cohen Gindi Date: Fri, 29 Aug 2014 10:57:53 +0300 Subject: Include Winsock2 header before windows.h include That's because there are duplicate #defines, and when Winsock2 is defined before windows.h then windows.h detects that and prevent redefinition. See http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4a90b143-1fb8-43e9-a54c-956127e0c579/windowsh-and-winsock2h?forum=windowssdk [JES: fixed commit message] Signed-off-by: Johannes Schindelin --- libvncclient/vncviewer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libvncclient/vncviewer.c') diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 8237254..5819c1d 100644 --- a/libvncclient/vncviewer.c +++ b/libvncclient/vncviewer.c @@ -21,6 +21,11 @@ * vncviewer.c - the Xt-based VNC viewer. */ +#ifdef WIN32 +#undef SOCKET +#include +#endif + #ifdef __STRICT_ANSI__ #define _BSD_SOURCE #define _POSIX_SOURCE @@ -44,8 +49,6 @@ static void DummyRect(rfbClient* client, int x, int y, int w, int h) { static char* NoPassword(rfbClient* client) { return strdup(""); } -#undef SOCKET -#include #define close closesocket #else #include -- cgit v1.2.1