diff options
Diffstat (limited to 'games/bzflag/files/patch-usbjoy.cxx')
-rw-r--r-- | games/bzflag/files/patch-usbjoy.cxx | 40 |
1 files changed, 27 insertions, 13 deletions
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 || |