summaryrefslogtreecommitdiffstats
path: root/libvncserver/websockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/websockets.c')
-rw-r--r--libvncserver/websockets.c20
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;