From 180f7d626c5bbe2170b3526eeb23b6b93ac21a1d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 2 Dec 2002 02:35:58 +0000 Subject: [PATCH] *** empty log message *** --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40553 --- src/joystick/bsd/SDL_sysjoystick.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/joystick/bsd/SDL_sysjoystick.c b/src/joystick/bsd/SDL_sysjoystick.c index 7225865bb..68702012e 100644 --- a/src/joystick/bsd/SDL_sysjoystick.c +++ b/src/joystick/bsd/SDL_sysjoystick.c @@ -32,6 +32,8 @@ static char rcsid = "@(#) $Id$"; #endif +#include + #include #include #include @@ -406,11 +408,20 @@ report_alloc(struct report *r, struct report_desc *rd, int repind) { int len; -#ifdef USBHID_NEW - len = hid_report_size(rd, repinfo[repind].kind, r->rid); -#else +#ifdef __FreeBSD__ +# if (__FreeBSD_version >= 470000) + len = hid_report_size(rd, r->rid, repinfo[repind].kind); +# else len = hid_report_size(rd, repinfo[repind].kind, &r->rid); #endif +#else +# 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 +#endif + if (len < 0) { SDL_SetError("Negative HID report size"); return (-1);