summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-04-09 04:51:09 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-04-09 04:51:09 +0000
commitaa3d7c479bbecbfb2d54a91a1e2567fd68f91103 (patch)
tree8e91d0d84cb01c56bd95846b748ac84efdc6021c /emulators
parentIn the REDHAT_LINUX list, add two sites from which Hewlett-Packard (diff)
Build fixes for __FreeBSD_version >= 500111 (usbhid changes.)
Notes
Notes: svn path=/head/; revision=78644
Diffstat (limited to 'emulators')
-rw-r--r--emulators/xmame/files/patch-src::unix::joystick-drivers::joy_usb.c58
-rw-r--r--emulators/xmame/files/patch-src::unix::unix.mak32
2 files changed, 90 insertions, 0 deletions
diff --git a/emulators/xmame/files/patch-src::unix::joystick-drivers::joy_usb.c b/emulators/xmame/files/patch-src::unix::joystick-drivers::joy_usb.c
new file mode 100644
index 000000000000..c96dc72eb3ba
--- /dev/null
+++ b/emulators/xmame/files/patch-src::unix::joystick-drivers::joy_usb.c
@@ -0,0 +1,58 @@
+--- src/unix/joystick-drivers/joy_usb.c.orig Mon Mar 17 22:36:59 2003
++++ src/unix/joystick-drivers/joy_usb.c Tue Apr 8 22:54:47 2003
+@@ -20,19 +20,27 @@
+ "Patches to support other archs are welcome ;)"
+ #endif
+
+-#if defined(__ARCH_netbsd)
+-#ifdef HAVE_USBHID_H
+-#include <usbhid.h>
++#if defined(HAVE_USBHID_H) || defined(HAVE_LIBUSBHID_H)
++# ifdef HAVE_USBHID_H
++# include <usbhid.h>
++# endif
++# ifdef HAVE_LIBUSBHID_H
++# include <libusbhid.h>
++# endif
+ #else
+-#include <usb.h>
+-#endif
+-#elif defined(__ARCH_freebsd)
+-#ifdef HAVE_USBHID_H
+-#include <libusbhid.h>
+-#else
+-#include <libusb.h>
++# ifdef __ARCH_netbsd
++# include <usb.h>
++# endif
++# ifdef __ARCH_freebsd
++# include <libusb.h>
++# endif
+ #endif
++
++#ifdef __ARCH_freebsd
++#include <osreldate.h>
++#include <sys/ioctl.h>
+ #endif
++
+ #include <dev/usb/usb.h>
+ #include <dev/usb/usbhid.h>
+
+@@ -90,7 +98,7 @@
+
+ priv_joy_data[i].hids = NULL;
+
+-#ifdef HAVE_USBHID_H
++#if defined(HAVE_USBHID_H) || defined(HAVE_LIBUSBHID_H)
+ #if defined(__ARCH_netbsd) || (defined(__ARCH_freebsd) && __FreeBSD_version > 500000)
+ if (ioctl(joy_data[i].fd, USB_GET_REPORT_ID, &report_id) < 0)
+ {
+@@ -114,7 +122,7 @@
+ priv_joy_data[i].dlen = size;
+
+ is_joystick = 0;
+-#if defined(__ARCH_netbsd) && defined(HAVE_USBHID_H)
++#if defined(HAVE_USBHID_H)
+ for (d = hid_start_parse(rd, 1 << hid_input, report_id);
+ hid_get_item(d, &h); )
+ #else
diff --git a/emulators/xmame/files/patch-src::unix::unix.mak b/emulators/xmame/files/patch-src::unix::unix.mak
index 1c652a13eeb8..321e8ffdcc61 100644
--- a/emulators/xmame/files/patch-src::unix::unix.mak
+++ b/emulators/xmame/files/patch-src::unix::unix.mak
@@ -20,3 +20,35 @@
endif
ifdef SOUND_WAVEOUT
+@@ -248,27 +248,20 @@
+ ifdef JOY_PS2
+ CONFIG += -DPS2_JOYSTICK
+ endif
++
+ ifdef JOY_USB
+ CONFIG += -DUSB_JOYSTICK
+-ifeq ($(ARCH), netbsd)
+ ifeq ($(shell test -f /usr/include/usbhid.h && echo have_usbhid), have_usbhid)
+ CONFIG += -DHAVE_USBHID_H
+ MY_LIBS += -lusbhid
+ else
+-MY_LIBS += -lusb
+-endif
+-else
+-ifeq ($(ARCH), freebsd)
+-ifeq ($(shell test -f /usr/include/libusbhid.h && echo have_usbhid), have_usbhid)
+-CONFIG += -DHAVE_USBHID_H
++ifeq ($(shell test -f /usr/include/libusbhid.h && echo have_libusbhid), have_libusbhid)
++CONFIG += -DHAVE_LIBUSBHID_H
+ MY_LIBS += -lusbhid
+-else
+-MY_LIBS += -lusb
++endif
+ endif
+ else
+ MY_LIBS += -lusb
+-endif
+-endif
+ endif
+
+ ifdef EFENCE