mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-11 02:50:24 +00:00
Unbroke on systems after libusb --> libusbhid conversion.
Reported by: Mike Murphree <w4lna@knology.net> Nuno Teixeira <nunotex@pt-quorum.com> Mark Sergeant <sarge@snsonline.net>
This commit is contained in:
parent
89b10cd027
commit
3d510485e5
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=57843
@ -49,6 +49,12 @@ CONFIGURE_ARGS+=--enable-video-opengl
|
||||
LIB_DEPENDS+= vga.1:${PORTSDIR}/graphics/svgalib
|
||||
CONFIGURE_ARGS+=--enable-video-svga
|
||||
.endif
|
||||
.if exists(/usr/include/libusbhid.h)
|
||||
CONFIGURE_ENV+= USB_LIBS=-lusbhid
|
||||
CFLAGS+= -DHAVE_LIBUSBHID_H
|
||||
.else
|
||||
CONFIGURE_ENV+= USB_LIBS=-lusb
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
|
@ -39,7 +39,7 @@ $FreeBSD$
|
||||
if test x$enable_joystick = xyes; then
|
||||
JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
|
||||
JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
|
||||
+ SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
|
||||
+ SYSTEM_LIBS="$SYSTEM_LIBS $USB_LIBS"
|
||||
fi
|
||||
# Set up files for the cdrom library
|
||||
if test x$enable_cdrom = xyes; then
|
||||
|
@ -1,18 +1,22 @@
|
||||
|
||||
$FreeBSD$
|
||||
|
||||
--- src/joystick/bsd/SDL_sysjoystick.c 2002/04/17 11:06:43 1.1
|
||||
+++ src/joystick/bsd/SDL_sysjoystick.c 2002/04/17 11:20:41
|
||||
@@ -41,7 +41,7 @@
|
||||
--- src/joystick/bsd/SDL_sysjoystick.c.orig Sun Mar 10 05:49:25 2002
|
||||
+++ src/joystick/bsd/SDL_sysjoystick.c Thu Apr 18 10:48:00 2002
|
||||
@@ -41,7 +41,11 @@
|
||||
|
||||
#include <dev/usb/usb.h>
|
||||
#include <dev/usb/usbhid.h>
|
||||
-#include <usbhid.h>
|
||||
+#if !defined(HAVE_LIBUSBHID_H)
|
||||
+#include <libusb.h>
|
||||
+#else
|
||||
+#include <libusbhid.h>
|
||||
+#endif
|
||||
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_joystick.h"
|
||||
@@ -205,7 +205,8 @@
|
||||
@@ -205,7 +209,8 @@
|
||||
joy->nballs = 0;
|
||||
|
||||
while (hid_get_item(hdata, &hitem) > 0) {
|
||||
@ -22,7 +26,7 @@ $FreeBSD$
|
||||
|
||||
switch (hitem.kind) {
|
||||
case hid_collection:
|
||||
@@ -275,7 +276,7 @@
|
||||
@@ -275,7 +280,7 @@
|
||||
Sint32 v;
|
||||
|
||||
rep = &joy->hwdata->inreport;
|
||||
@ -31,7 +35,7 @@ $FreeBSD$
|
||||
return;
|
||||
}
|
||||
hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
|
||||
@@ -310,7 +311,7 @@
|
||||
@@ -310,7 +315,7 @@
|
||||
goto scaleaxe;
|
||||
}
|
||||
scaleaxe:
|
||||
@ -40,7 +44,7 @@ $FreeBSD$
|
||||
if (v != 127) {
|
||||
if (v < 127) {
|
||||
v = -(256 - v);
|
||||
@@ -329,7 +330,7 @@
|
||||
@@ -329,7 +334,7 @@
|
||||
}
|
||||
break;
|
||||
case HUP_BUTTON:
|
||||
@ -49,16 +53,20 @@ $FreeBSD$
|
||||
&hitem);
|
||||
if (joy->buttons[nbutton] != v) {
|
||||
SDL_PrivateJoystickButton(joy,
|
||||
@@ -381,7 +382,7 @@
|
||||
@@ -381,7 +386,12 @@
|
||||
{
|
||||
int len;
|
||||
|
||||
- len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
|
||||
+#if !defined(HAVE_LIBUSBHID_H)
|
||||
len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
|
||||
+#else
|
||||
+ len = hid_report_size(rd, r->rid, repinfo[repind].kind);
|
||||
+#endif
|
||||
+
|
||||
if (len < 0) {
|
||||
SDL_SetError("Negative HID report size");
|
||||
return (-1);
|
||||
@@ -389,7 +390,7 @@
|
||||
@@ -389,7 +399,7 @@
|
||||
r->size = len;
|
||||
|
||||
if (r->size > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user