diff src/joystick/bsd/SDL_sysjoystick.c @ 407:173909e17b7f

API changes on OpenBSD and FreeBSD...
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jun 2002 03:32:01 +0000
parents b5de7389a0a5
children 33712e5d1ec8
line wrap: on
line diff
--- a/src/joystick/bsd/SDL_sysjoystick.c	Wed Jun 12 03:30:58 2002 +0000
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Wed Jun 12 03:32:01 2002 +0000
@@ -29,7 +29,7 @@
 
 #ifdef SAVE_RCSID
 static char rcsid =
- "@(#) $Id $";
+ "@(#) $Id$";
 #endif
 
 #include <stdio.h>
@@ -210,7 +210,11 @@
 		goto usberr;
 	}
 
+#ifdef USBHID_NEW
+	hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
+#else
 	hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
+#endif
 	if (hdata == NULL) {
 		SDL_SetError("%s: Cannot start HID parser", hw->path);
 		goto usberr;
@@ -296,7 +300,11 @@
 	if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
 		return;
 	}
+#ifdef USBHID_NEW
+	hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
+#else
 	hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
+#endif
 	if (hdata == NULL) {
 		fprintf(stderr, "%s: Cannot start HID parser\n",
 		    joy->hwdata->path);
@@ -400,7 +408,11 @@
 {
 	int len;
 
+#ifdef USBHID_NEW
+	len = hid_report_size(rd, repinfo[repind].kind, r->rid);
+#else
 	len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
+#endif
 	if (len < 0) {
 		SDL_SetError("Negative HID report size");
 		return (-1);