summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Cohen Gindi <danielgindi@gmail.com>2014-08-29 10:57:53 +0300
committerJohannes Schindelin <johannes.schindelin@gmx.de>2014-09-02 16:13:04 +0200
commit30592827518d8af36d1e686b48ecbc20b502a993 (patch)
tree46cb788eb7e78740734c33e2e2f50ce9b8b9a5a2
parent914460cac55ed7cbc72ad3585e3bab22b6f4cc8c (diff)
downloadlibvncserver-30592827518d8af36d1e686b48ecbc20b502a993.zip
libvncserver-30592827518d8af36d1e686b48ecbc20b502a993.tar.gz
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 <johannes.schindelin@gmx.de>
-rw-r--r--libvncclient/vncviewer.c7
1 files changed, 5 insertions, 2 deletions
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 <winsock2.h>
+#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 <winsock2.h>
#define close closesocket
#else
#include <stdio.h>
OpenPOWER on IntegriCloud