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>
pull/1/head
Daniel Cohen Gindi 10 years ago committed by Johannes Schindelin
parent 914460cac5
commit 3059282751

@ -21,6 +21,11 @@
* vncviewer.c - the Xt-based VNC viewer. * vncviewer.c - the Xt-based VNC viewer.
*/ */
#ifdef WIN32
#undef SOCKET
#include <winsock2.h>
#endif
#ifdef __STRICT_ANSI__ #ifdef __STRICT_ANSI__
#define _BSD_SOURCE #define _BSD_SOURCE
#define _POSIX_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) { static char* NoPassword(rfbClient* client) {
return strdup(""); return strdup("");
} }
#undef SOCKET
#include <winsock2.h>
#define close closesocket #define close closesocket
#else #else
#include <stdio.h> #include <stdio.h>

Loading…
Cancel
Save