summaryrefslogtreecommitdiff
path: root/games/bzflag
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-05-04 19:05:34 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-05-04 19:05:34 +0000
commit17ee41006f3684e3288a685f9569c9555baa58f4 (patch)
tree6c63aae9f658cbe9453d70faa2083631a5b90e3c /games/bzflag
parentUpgrade to 010. (diff)
Fix build on -CURRENT; usbhid issue.
Notes
Notes: svn path=/head/; revision=80117
Diffstat (limited to 'games/bzflag')
-rw-r--r--games/bzflag/Makefile2
-rw-r--r--games/bzflag/files/patch-XWindow.h19
-rw-r--r--games/bzflag/files/patch-usbjoy.cxx40
3 files changed, 46 insertions, 15 deletions
diff --git a/games/bzflag/Makefile b/games/bzflag/Makefile
index 2ef9d4c610b3..3df7be426f9f 100644
--- a/games/bzflag/Makefile
+++ b/games/bzflag/Makefile
@@ -28,8 +28,6 @@ MAN6= bzflag.6 bzfrelay.6 bzfls.6 bzfs.6
do-configure:
@${CP} ${FILESDIR}/config-sys ${WRKSRC}/
- ${REINPLACE_CMD} "s,libusb.h,libusbhid.h,g" \
- ${WRKSRC}/src/platform/XWindow.h
${REINPLACE_CMD} "s,malloc.h,stdlib.h,g" \
${WRKSRC}/src/bzflag/HUDRenderer.cxx
diff --git a/games/bzflag/files/patch-XWindow.h b/games/bzflag/files/patch-XWindow.h
new file mode 100644
index 000000000000..c836f83664d4
--- /dev/null
+++ b/games/bzflag/files/patch-XWindow.h
@@ -0,0 +1,19 @@
+--- src/platform/XWindow.h.bak Tue Jun 4 02:39:32 2002
++++ src/platform/XWindow.h Sun May 4 14:23:23 2003
+@@ -35,9 +35,14 @@
+ extern "C" {
+ #endif
+ #ifdef __FreeBSD__
+-#include <libusb.h>
++# include <osreldate.h>
++# if __FreeBSD_version >= 500111
++# include <usbhid.h>
++# else
++# include <libusbhid.h>
++# endif
+ #else
+-#include <usb.h>
++# include <usb.h>
+ #endif
+ #include <dev/usb/usb.h>
+ #include <dev/usb/usbhid.h>
diff --git a/games/bzflag/files/patch-usbjoy.cxx b/games/bzflag/files/patch-usbjoy.cxx
index e0b4e59eaa45..c749716f656e 100644
--- a/games/bzflag/files/patch-usbjoy.cxx
+++ b/games/bzflag/files/patch-usbjoy.cxx
@@ -1,6 +1,6 @@
---- src/platform/usbjoy.cxx Wed Sep 18 22:28:34 2002
-+++ src/platform/usbjoy.cxx.new Wed Sep 18 22:28:22 2002
-@@ -46,14 +46,14 @@
+--- src/platform/usbjoy.cxx.orig Tue Jun 4 02:39:32 2002
++++ src/platform/usbjoy.cxx Sun May 4 14:36:38 2003
+@@ -46,7 +46,7 @@
int data_buf_offset;
};
@@ -9,21 +9,27 @@
usb_joystick::usb_joystick(const char *name)
{
- report_desc_t rd;
- hid_data *d;
- hid_item h;
-- int report_id;
-+ hid_kind_t k;
-
+@@ -58,6 +58,7 @@
status = FALSE;
hids = NULL;
-@@ -67,11 +67,12 @@
+ num_axis = 0;
++ report_id = 0;
+
+ if ((fd = open(name, O_RDONLY | O_NONBLOCK))<0)
+ return;
+@@ -67,15 +68,27 @@
return;
}
-- data_buf_size = hid_report_size(rd, hid_input, &report_id);
-+ k = hid_input;
-+ data_buf_size = hid_report_size(rd, hid_input, k);
++#if (__FreeBSD_version >= 470000)
++# if (__FreeBSD_version >= 500111)
++ data_buf_size = hid_report_size(rd, hid_input, report_id);
++# else
++ data_buf_size = hid_report_size(rd, report_id, hid_input);
++# endif
++#else
+ data_buf_size = hid_report_size(rd, hid_input, &report_id);
++#endif
if ((data_buf = (char *)malloc(data_buf_size)) == NULL) {
hid_dispose_report_desc(rd);
}
@@ -32,3 +38,11 @@
int is_joystick = 0;
int interesting_hid = FALSE;
++#if (__FreeBSD_version >= 500111)
++ for (d = hid_start_parse(rd, 1 << hid_input, report_id); hid_get_item(d, &h); ) {
++#else
+ for (d = hid_start_parse(rd, 1 << hid_input); hid_get_item(d, &h); ) {
++#endif
+ int page = HID_PAGE(h.usage);
+ int usage = HID_USAGE(h.usage);
+ is_joystick = is_joystick ||