diff options
author | Daniel Cohen Gindi <danielgindi@gmail.com> | 2014-09-20 17:16:52 +0300 |
---|---|---|
committer | Daniel Cohen Gindi <danielgindi@gmail.com> | 2014-09-20 17:46:33 +0300 |
commit | 901eba9f4608de6af231fde34264ede878c4d253 (patch) | |
tree | 5f75406c2fad59e6148010948a5c3d23088bf6f0 /libvncserver | |
parent | 8c58593649f385a8bbaafefc768181d7a24c463d (diff) | |
download | libtdevnc-901eba9f4608de6af231fde34264ede878c4d253.tar.gz libtdevnc-901eba9f4608de6af231fde34264ede878c4d253.zip |
Generally adjusting headers for compiling on windows without the mixing of Winsock 1 and 2.
Diffstat (limited to 'libvncserver')
-rw-r--r-- | libvncserver/httpd.c | 9 | ||||
-rw-r--r-- | libvncserver/rfbserver.c | 2 | ||||
-rw-r--r-- | libvncserver/sockets.c | 5 |
3 files changed, 15 insertions, 1 deletions
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c index 5bac9f9..12d71a8 100644 --- a/libvncserver/httpd.c +++ b/libvncserver/httpd.c @@ -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> diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index e87fa42..abe2475 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -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 diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c index 31dddd6..a7a829a 100644 --- a/libvncserver/sockets.c +++ b/libvncserver/sockets.c @@ -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 |