diff options
author | Michael Turvey <mwturvey@users.noreply.github.com> | 2018-03-10 23:31:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-10 23:31:28 -0700 |
commit | 8eea660564e8fa9e1f5f01a278e1df9898694975 (patch) | |
tree | 504786ff79dcac436229e7c6e6a97ae305a38293 /src/survive_vive.c | |
parent | c3f6a9a94575035b4226fc646989d561efe5c3f4 (diff) | |
parent | 8ef086fb0524f8d9958de96276790952562902ef (diff) | |
download | libsurvive-8eea660564e8fa9e1f5f01a278e1df9898694975.tar.gz libsurvive-8eea660564e8fa9e1f5f01a278e1df9898694975.tar.bz2 |
Merge pull request #108 from mwturvey/fix_save_restore_LH_POS
Fix MSVC & Fix Saving & Restoring PositionSet bit
Diffstat (limited to 'src/survive_vive.c')
-rwxr-xr-x | src/survive_vive.c | 16 |
1 files changed, 16 insertions, 0 deletions
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) |