$OpenBSD: patch-src_unix_joystick-drivers_joy_usb_c,v 1.5 2002/05/25 01:18:00 pvalchev Exp $
--- src/unix/joystick-drivers/joy_usb.c.orig	Fri Nov  2 18:22:56 2001
+++ src/unix/joystick-drivers/joy_usb.c	Fri May 24 13:49:05 2002
@@ -15,13 +15,13 @@ struct rc_option joy_usb_opts[] = {
 
 #ifdef USB_JOYSTICK
 
-#if !defined(__ARCH_netbsd) && !defined(__ARCH_freebsd)
-#error "USB joysticks are only supported under NetBSD and FreeBSD. "
+#if !defined(__ARCH_netbsd) && !defined(__ARCH_freebsd) && !defined(__ARCH_openbsd)
+#error "USB joysticks are only supported under NetBSD, FreeBSD and OpenBSD. "
    "Patches to support other archs are welcome ;)"
 #endif
 
-#if defined(__ARCH_netbsd)
-#include <usb.h>
+#if defined(__ARCH_netbsd) || defined(__ARCH_openbsd)
+#include <usbhid.h>
 #elif defined(__ARCH_freebsd)
 #include <libusb.h>
 #endif
@@ -82,7 +82,7 @@ static int joy_initialize_hid(int i)
 
   priv_joy_data[i].hids = NULL;
 
-  size = hid_report_size(rd, hid_input, &report_id);
+  size = hid_report_size(rd, hid_input, report_id);
   if ((priv_joy_data[i].data_buf = malloc(size)) == NULL)
     {
       fprintf(stderr_file, "error: couldn't malloc %d bytes\n", size);
@@ -93,7 +93,7 @@ static int joy_initialize_hid(int i)
   priv_joy_data[i].offset = (report_id != 0);
 
   is_joystick = 0;
-  for (d = hid_start_parse(rd, 1 << hid_input); hid_get_item(d, &h); )
+  for (d = hid_start_parse(rd, 1 << hid_input, NULL); hid_get_item(d, &h); )
     {
       int axis, usage, page, interesting_hid;
 
