From 5e59c6805ff7555930c9f10097cda6d90d57ee78 Mon Sep 17 00:00:00 2001 From: Mike Turvey Date: Sat, 10 Mar 2018 23:07:43 -0700 Subject: Fix MSVC build --- src/survive_vive.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/survive_vive.c') diff --git a/src/survive_vive.c b/src/survive_vive.c index 5001efd..f250c22 100755 --- a/src/survive_vive.c +++ b/src/survive_vive.c @@ -904,6 +904,7 @@ int survive_get_config( char ** config, SurviveViveData * sv, int devno, int ifa #define POP1 (*(readdata++)) +#ifndef _MSC_VER struct __attribute__((__packed__)) unaligned_16_t { int16_t v; }; @@ -916,6 +917,21 @@ struct __attribute__((__packed__)) unaligned_u16_t { struct __attribute__((__packed__)) unaligned_u32_t { uint32_t v; }; +#else +struct unaligned_16_t { + int16_t v; +}; +struct unaligned_32_t { + int32_t v; +}; +struct unaligned_u16_t { + uint16_t v; +}; +struct unaligned_u32_t { + uint32_t v; +}; +#endif + #define POP2 ((((( struct unaligned_u16_t*)((readdata+=2)-2))))->v) #define POP4 ((((( struct unaligned_u32_t*)((readdata+=4)-4))))->v) -- cgit v1.2.3