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>
This commit is contained in:
Jakob Bornecrantz authored and Marge Bot committed 2025-06-26 17:33:56 +00:00
1 parent 941369f840
commit 4d2cb296ea
4 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -155,7 +155,7 @@ p_dump_device(struct prober *p, struct prober_device *pdev, int id, bool use_std
for (size_t j = 0; j < pdev->num_hidraws; j++) {
struct prober_hidraw *hidraw = &pdev->hidraws[j];
PTT("hidraw.iface: %i", (int)hidraw->interface);
PTT("hidraw.iface: %i", (int)hidraw->hid_iface);
PTT("hidraw.path: '%s'", hidraw->path);
}
#endif
+5 -5
View File
@@ -101,7 +101,7 @@ p_select_device(struct xrt_prober *xp, struct xrt_device **xdevs, size_t xdev_co
static int
p_open_hid_interface(struct xrt_prober *xp,
struct xrt_prober_device *xpdev,
int interface,
int hid_iface,
struct os_hid_device **out_hid_dev);
static int
@@ -1185,7 +1185,7 @@ p_select_device(struct xrt_prober *xp, struct xrt_device **xdevs, size_t xdev_co
static int
p_open_hid_interface(struct xrt_prober *xp,
struct xrt_prober_device *xpdev,
int interface,
int hid_iface,
struct os_hid_device **out_hid_dev)
{
XRT_TRACE_MARKER();
@@ -1197,7 +1197,7 @@ p_open_hid_interface(struct xrt_prober *xp,
for (size_t j = 0; j < pdev->num_hidraws; j++) {
struct prober_hidraw *hidraw = &pdev->hidraws[j];
if (hidraw->interface != interface) {
if (hidraw->hid_iface != hid_iface) {
continue;
}
@@ -1210,13 +1210,13 @@ p_open_hid_interface(struct xrt_prober *xp,
return 0;
}
U_LOG_E("Could not find the requested hid interface (%i) on the device!", interface);
U_LOG_E("Could not find the requested hid interface (%i) on the device!", hid_iface);
return -1;
#elif defined(XRT_OS_WINDOWS)
(void)pdev;
(void)ret;
U_LOG_E("HID devices not yet supported on Windows, cannot open interface (%i)", interface);
U_LOG_E("HID devices not yet supported on Windows, cannot open interface (%i)", hid_iface);
return -1;
#else
#error "no port of hid code"
+1 -1
View File
@@ -50,7 +50,7 @@
*/
struct prober_hidraw
{
ssize_t interface;
ssize_t hid_iface;
const char *path;
};
+2 -2
View File
@@ -493,14 +493,14 @@ p_udev_enumerate_hidraw(struct prober *p, struct udev *udev)
}
static void
p_udev_add_hidraw(struct prober_device *pdev, uint32_t interface, const char *path)
p_udev_add_hidraw(struct prober_device *pdev, uint32_t hid_iface, const char *path)
{
U_ARRAY_REALLOC_OR_FREE(pdev->hidraws, struct prober_hidraw, (pdev->num_hidraws + 1));
struct prober_hidraw *hidraw = &pdev->hidraws[pdev->num_hidraws++];
U_ZERO(hidraw);
hidraw->interface = interface;
hidraw->hid_iface = hid_iface;
hidraw->path = strdup(path);
}