summarylogtreecommitdiffstats
path: root/0001-openvr_capi-Add-pragma-pack-around-VRControllerState.patch
blob: cd13f06c1e633687018fd74086b440086cade8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 82e34cf8220853396a4494ab16431ab7a9d87e34 Mon Sep 17 00:00:00 2001
From: Christoph Haag <christoph.haag@collabora.com>
Date: Wed, 8 Aug 2018 01:06:29 +0200
Subject: [PATCH 1/3] openvr_capi: Add pragma pack around VRControllerState_t.

See https://github.com/ValveSoftware/SteamVR-for-Linux/issues/35
---
 headers/openvr_capi.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/headers/openvr_capi.h b/headers/openvr_capi.h
index f6743de..5893e6e 100644
--- a/headers/openvr_capi.h
+++ b/headers/openvr_capi.h
@@ -1995,6 +1995,11 @@ typedef struct VRControllerAxis_t
 	float y;
 } VRControllerAxis_t;
 
+#if defined(__linux__) || defined(__APPLE__)
+// This structure was originally defined mis-packed on Linux, preserved for
+// compatibility.
+#pragma pack( push, 4 )
+#endif
 typedef struct VRControllerState_t
 {
 	uint32_t unPacketNum;
@@ -2002,6 +2007,9 @@ typedef struct VRControllerState_t
 	uint64_t ulButtonTouched;
 	struct VRControllerAxis_t rAxis[5]; //struct vr::VRControllerAxis_t[5]
 } VRControllerState_t;
+#if defined(__linux__) || defined(__APPLE__)
+#pragma pack( pop )
+#endif
 
 typedef struct Compositor_OverlaySettings
 {
-- 
2.23.0