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 #include #define close closesocket +#define strcasecmp _stricmp #if defined(_MSC_VER) #include /* 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 #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 #include #include "private.h" +#include "rfb/rfbconfig.h" #ifdef LIBVNCSERVER_HAVE_FCNTL_H #include @@ -74,7 +75,9 @@ /* stst() */ #include #include +#if LIBVNCSERVER_HAVE_UNISTD_H #include +#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 +#if LIBVNCSERVER_HAVE_UNISTD_H #include +#endif #include #include 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 #include #include +#if LIBVNCSERVER_HAVE_UNISTD_H #include +#endif #ifndef _MSC_VER #include #include 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 +#if LIBVNCSERVER_UNISTD_H #include +#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 #ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H #undef socklen_t