Various #ifdef fixes to allow building with MSVC2014

pull/3/head
Christian Beier 7 years ago
parent 37f293d588
commit 7368417239

@ -88,7 +88,11 @@ struct md5_ctx
md5_uint32 total[2]; md5_uint32 total[2];
md5_uint32 buflen; md5_uint32 buflen;
char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32)))); char buffer[128]
#if __GNUC__
__attribute__ ((__aligned__ (__alignof__ (md5_uint32))))
#endif
;
}; };
/* /*

@ -47,6 +47,7 @@
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#define close closesocket #define close closesocket
#define strcasecmp _stricmp
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include <BaseTsd.h> /* For the missing ssize_t */ #include <BaseTsd.h> /* For the missing ssize_t */
#define ssize_t SSIZE_T #define ssize_t SSIZE_T

@ -1,6 +1,7 @@
#ifndef _RFB_CRYPTO_H #ifndef _RFB_CRYPTO_H
#define _RFB_CRYPTO_H 1 #define _RFB_CRYPTO_H 1
#ifdef LIBVNCSERVER_HAVE_UIO_H
#include <sys/uio.h> #include <sys/uio.h>
#define SHA1_HASH_SIZE 20 #define SHA1_HASH_SIZE 20
@ -8,5 +9,6 @@
void digestmd5(const struct iovec *iov, int iovcnt, void *dest); void digestmd5(const struct iovec *iov, int iovcnt, void *dest);
void digestsha1(const struct iovec *iov, int iovcnt, void *dest); void digestsha1(const struct iovec *iov, int iovcnt, void *dest);
#endif
#endif #endif

@ -37,6 +37,7 @@
#include <rfb/rfb.h> #include <rfb/rfb.h>
#include <rfb/rfbregion.h> #include <rfb/rfbregion.h>
#include "private.h" #include "private.h"
#include "rfb/rfbconfig.h"
#ifdef LIBVNCSERVER_HAVE_FCNTL_H #ifdef LIBVNCSERVER_HAVE_FCNTL_H
#include <fcntl.h> #include <fcntl.h>
@ -74,7 +75,9 @@
/* stst() */ /* stst() */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifndef WIN32 #ifndef WIN32
/* readdir() */ /* readdir() */

@ -56,7 +56,9 @@
#endif #endif
#include <errno.h> #include <errno.h>
#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>

@ -29,7 +29,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#ifndef _MSC_VER #ifndef _MSC_VER
#include <dirent.h> #include <dirent.h>
#include <pthread.h> #include <pthread.h>

@ -49,7 +49,9 @@
#endif #endif
#include <string.h> #include <string.h>
#if LIBVNCSERVER_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include "rfb/rfbconfig.h" #include "rfb/rfbconfig.h"
#include "rfbssl.h" #include "rfbssl.h"
#include "rfbcrypto.h" #include "rfbcrypto.h"
@ -116,15 +118,27 @@ typedef union ws_mask_s {
* it from recognizing anonymous structs and unions. * it from recognizing anonymous structs and unions.
* See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4784 * 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 b0;
unsigned char b1; unsigned char b1;
union { union {
struct __attribute__ ((__packed__)) { struct
#if __GNUC__
__attribute__ ((__packed__))
#endif
{
uint16_t l16; uint16_t l16;
ws_mask_t m16; ws_mask_t m16;
} s16; } s16;
struct __attribute__ ((__packed__)) { struct
#if __GNUC__
__attribute__ ((__packed__))
#endif
{
uint64_t l64; uint64_t l64;
ws_mask_t m64; ws_mask_t m64;
} s64; } s64;

@ -54,6 +54,7 @@ extern "C"
#ifdef WIN32 #ifdef WIN32
#undef SOCKET #undef SOCKET
typedef UINT32 in_addr_t;
#include <winsock2.h> #include <winsock2.h>
#ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H #ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H
#undef socklen_t #undef socklen_t

Loading…
Cancel
Save