The open source OpenXR runtime

st/prober: On Windows interface is basically a reserved identifier

Thanks to combaseapi.h we can't use that name.
Similar issue: https://issues.chromium.org/issues/40130800

Reported-by: Michael Haselton <mhaselton@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2491>

authored by

Jakob Bornecrantz and committed by
Marge Bot
4d2cb296 941369f8

+9 -9
+1 -1
src/xrt/state_trackers/prober/p_dump.c
··· 155 155 for (size_t j = 0; j < pdev->num_hidraws; j++) { 156 156 struct prober_hidraw *hidraw = &pdev->hidraws[j]; 157 157 158 - PTT("hidraw.iface: %i", (int)hidraw->interface); 158 + PTT("hidraw.iface: %i", (int)hidraw->hid_iface); 159 159 PTT("hidraw.path: '%s'", hidraw->path); 160 160 } 161 161 #endif
+5 -5
src/xrt/state_trackers/prober/p_prober.c
··· 101 101 static int 102 102 p_open_hid_interface(struct xrt_prober *xp, 103 103 struct xrt_prober_device *xpdev, 104 - int interface, 104 + int hid_iface, 105 105 struct os_hid_device **out_hid_dev); 106 106 107 107 static int ··· 1185 1185 static int 1186 1186 p_open_hid_interface(struct xrt_prober *xp, 1187 1187 struct xrt_prober_device *xpdev, 1188 - int interface, 1188 + int hid_iface, 1189 1189 struct os_hid_device **out_hid_dev) 1190 1190 { 1191 1191 XRT_TRACE_MARKER(); ··· 1197 1197 for (size_t j = 0; j < pdev->num_hidraws; j++) { 1198 1198 struct prober_hidraw *hidraw = &pdev->hidraws[j]; 1199 1199 1200 - if (hidraw->interface != interface) { 1200 + if (hidraw->hid_iface != hid_iface) { 1201 1201 continue; 1202 1202 } 1203 1203 ··· 1210 1210 return 0; 1211 1211 } 1212 1212 1213 - U_LOG_E("Could not find the requested hid interface (%i) on the device!", interface); 1213 + U_LOG_E("Could not find the requested hid interface (%i) on the device!", hid_iface); 1214 1214 return -1; 1215 1215 1216 1216 #elif defined(XRT_OS_WINDOWS) 1217 1217 (void)pdev; 1218 1218 (void)ret; 1219 - U_LOG_E("HID devices not yet supported on Windows, cannot open interface (%i)", interface); 1219 + U_LOG_E("HID devices not yet supported on Windows, cannot open interface (%i)", hid_iface); 1220 1220 return -1; 1221 1221 #else 1222 1222 #error "no port of hid code"
+1 -1
src/xrt/state_trackers/prober/p_prober.h
··· 50 50 */ 51 51 struct prober_hidraw 52 52 { 53 - ssize_t interface; 53 + ssize_t hid_iface; 54 54 const char *path; 55 55 }; 56 56
+2 -2
src/xrt/state_trackers/prober/p_udev.c
··· 493 493 } 494 494 495 495 static void 496 - p_udev_add_hidraw(struct prober_device *pdev, uint32_t interface, const char *path) 496 + p_udev_add_hidraw(struct prober_device *pdev, uint32_t hid_iface, const char *path) 497 497 { 498 498 U_ARRAY_REALLOC_OR_FREE(pdev->hidraws, struct prober_hidraw, (pdev->num_hidraws + 1)); 499 499 500 500 struct prober_hidraw *hidraw = &pdev->hidraws[pdev->num_hidraws++]; 501 501 U_ZERO(hidraw); 502 502 503 - hidraw->interface = interface; 503 + hidraw->hid_iface = hid_iface; 504 504 hidraw->path = strdup(path); 505 505 } 506 506