diff options
author | Christian Beier <dontmind@freeshell.org> | 2017-01-28 21:02:11 +0100 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2017-01-28 21:02:11 +0100 |
commit | 73684172397d63c4274d7fbdf940f428cf31744c (patch) | |
tree | e76a49de1af950fece3cf88c30b2fe3e3dfa736a /libvncserver/websockets.c | |
parent | 37f293d58873114fc02a4df4081ba9936da1fd71 (diff) | |
download | libtdevnc-73684172397d63c4274d7fbdf940f428cf31744c.tar.gz libtdevnc-73684172397d63c4274d7fbdf940f428cf31744c.zip |
Various #ifdef fixes to allow building with MSVC2014
Diffstat (limited to 'libvncserver/websockets.c')
-rw-r--r-- | libvncserver/websockets.c | 20 |
1 files changed, 17 insertions, 3 deletions
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; |