summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2017-01-28 21:02:11 +0100
committerChristian Beier <dontmind@freeshell.org>2017-01-28 21:02:11 +0100
commit73684172397d63c4274d7fbdf940f428cf31744c (patch)
treee76a49de1af950fece3cf88c30b2fe3e3dfa736a
parent37f293d58873114fc02a4df4081ba9936da1fd71 (diff)
downloadlibtdevnc-73684172.tar.gz
libtdevnc-73684172.zip
Various #ifdef fixes to allow building with MSVC2014
-rw-r--r--common/md5.h6
-rw-r--r--libvncserver/httpd.c1
-rw-r--r--libvncserver/rfbcrypto.h2
-rw-r--r--libvncserver/rfbserver.c3
-rw-r--r--libvncserver/tightvnc-filetransfer/filetransfermsg.c2
-rw-r--r--libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c2
-rw-r--r--libvncserver/websockets.c20
-rw-r--r--rfb/rfb.h1
8 files changed, 33 insertions, 4 deletions
diff --git a/common/md5.h b/common/md5.h
index 0fb0a4a..b0daab1 100644
--- a/common/md5.h
+++ b/common/md5.h
@@ -88,7 +88,11 @@ struct md5_ctx
md5_uint32 total[2];
md5_uint32 buflen;
- char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
+ char buffer[128]
+#if __GNUC__
+ __attribute__ ((__aligned__ (__alignof__ (md5_uint32))))
+#endif
+ ;
};
/*
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c
index 8634b15..26d49af 100644
--- a/libvncserver/httpd.c
+++ b/libvncserver/httpd.c
@@ -47,6 +47,7 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#define close closesocket
+#define strcasecmp _stricmp
#if defined(_MSC_VER)
#include <BaseTsd.h> /* For the missing ssize_t */
#define ssize_t SSIZE_T
diff --git a/libvncserver/rfbcrypto.h b/libvncserver/rfbcrypto.h
index 9dc3e63..7853154 100644
--- a/libvncserver/rfbcrypto.h
+++ b/libvncserver/rfbcrypto.h
@@ -1,6 +1,7 @@
#ifndef _RFB_CRYPTO_H
#define _RFB_CRYPTO_H 1
+#ifdef LIBVNCSERVER_HAVE_UIO_H
#include <sys/uio.h>
#define SHA1_HASH_SIZE 20
@@ -8,5 +9,6 @@
void digestmd5(const struct iovec *iov, int iovcnt, void *dest);
void digestsha1(const struct iovec *iov, int iovcnt, void *dest);
+#endif
#endif
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index bc9cc11..040238d 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -37,6 +37,7 @@
#include <rfb/rfb.h>
#include <rfb/rfbregion.h>
#include "private.h"
+#include "rfb/rfbconfig.h"
#ifdef LIBVNCSERVER_HAVE_FCNTL_H
#include <fcntl.h>
@@ -74,7 +75,9 @@
/* stst() */
#include <sys/types.h>
#include <sys/stat.h>
+#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#ifndef WIN32
/* readdir() */
diff --git a/libvncserver/tightvnc-filetransfer/filetransfermsg.c b/libvncserver/tightvnc-filetransfer/filetransfermsg.c
index 153f123..5f84e7f 100644
--- a/libvncserver/tightvnc-filetransfer/filetransfermsg.c
+++ b/libvncserver/tightvnc-filetransfer/filetransfermsg.c
@@ -56,7 +56,9 @@
#endif
#include <errno.h>
+#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c b/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
index b235fa0..c511eed 100644
--- a/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
+++ b/libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c
@@ -29,7 +29,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#ifndef _MSC_VER
#include <dirent.h>
#include <pthread.h>
diff --git a/libvncserver/websockets.c b/libvncserver/websockets.c
index f596ab1..72396c2 100644
--- a/libvncserver/websockets.c
+++ b/libvncserver/websockets.c
@@ -49,7 +49,9 @@
#endif
#include <string.h>
+#if LIBVNCSERVER_UNISTD_H
#include <unistd.h>
+#endif
#include "rfb/rfbconfig.h"
#include "rfbssl.h"
#include "rfbcrypto.h"
@@ -116,15 +118,27 @@ typedef union ws_mask_s {
* it from recognizing anonymous structs and unions.
* See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4784
*/
-typedef struct __attribute__ ((__packed__)) ws_header_s {
+typedef struct
+#if __GNUC__
+__attribute__ ((__packed__))
+#endif
+ws_header_s {
unsigned char b0;
unsigned char b1;
union {
- struct __attribute__ ((__packed__)) {
+ struct
+#if __GNUC__
+ __attribute__ ((__packed__))
+#endif
+ {
uint16_t l16;
ws_mask_t m16;
} s16;
- struct __attribute__ ((__packed__)) {
+ struct
+#if __GNUC__
+__attribute__ ((__packed__))
+#endif
+ {
uint64_t l64;
ws_mask_t m64;
} s64;
diff --git a/rfb/rfb.h b/rfb/rfb.h
index c6edc11..f982b40 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -54,6 +54,7 @@ extern "C"
#ifdef WIN32
#undef SOCKET
+typedef UINT32 in_addr_t;
#include <winsock2.h>
#ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H
#undef socklen_t