Generally adjusting headers for compiling on windows without the mixing of Winsock 1 and 2.

pull/1/head
Daniel Cohen Gindi 10 years ago
parent 8c58593649
commit 901eba9f46

@ -43,8 +43,15 @@
#include <errno.h>
#ifdef WIN32
#include <winsock.h>
#include <io.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#define close closesocket
#if defined(_MSC_VER)
#include <BaseTsd.h> /* For the missing ssize_t */
#define ssize_t SSIZE_T
#define read _read /* Prevent POSIX deprecation warnings */
#endif
#else
#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
#include <sys/time.h>

@ -43,6 +43,8 @@
#endif
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <io.h>
#define write(sock,buf,len) send(sock,buf,len,0)
#else

@ -98,6 +98,8 @@ int deny_severity=LOG_WARNING;
#endif
#if defined(WIN32)
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef __MINGW32__
#pragma warning (disable: 4018 4761)
#endif
@ -110,6 +112,9 @@ int deny_severity=LOG_WARNING;
#endif
#ifdef _MSC_VER
#define SHUT_RD 0x00
#define SHUT_WR 0x01
#define SHUT_RDWR 0x02
#define snprintf _snprintf /* Missing in MSVC */
#endif

@ -31,6 +31,10 @@
* @file rfbclient.h
*/
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN /* Prevent loading any Winsock 1.x headers from windows.h */
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Loading…
Cancel
Save