Debian patch: 215_kfreebsd_gnu.diff SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sun, 18 Jul 2010 08:12:48 -0700
branchSDL-1.2
changeset 4540e978b888d87a
parent 4539 d2517c0de52b
child 4541 abb56f7699ea
Debian patch: 215_kfreebsd_gnu.diff
src/joystick/bsd/SDL_sysjoystick.c
     1.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Sun Jul 18 07:55:34 2010 -0700
     1.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sun Jul 18 08:12:48 2010 -0700
     1.3 @@ -59,7 +59,7 @@
     1.4  #include <libusbhid.h>
     1.5  #endif
     1.6  
     1.7 -#ifdef __FREEBSD__
     1.8 +#if defined(__FREEBSD__) || defined(__FreeBSD_kernel__)
     1.9  #ifndef __DragonFly__
    1.10  #include <osreldate.h>
    1.11  #endif
    1.12 @@ -78,7 +78,7 @@
    1.13  #define MAX_JOY_JOYS	2
    1.14  #define MAX_JOYS	(MAX_UHID_JOYS + MAX_JOY_JOYS)
    1.15  
    1.16 -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
    1.17 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) && false
    1.18  struct usb_ctl_report {
    1.19  	int	ucr_report;
    1.20  	u_char	ucr_data[1024]; /* filled data size will vary */
    1.21 @@ -148,7 +148,7 @@
    1.22  static int	report_alloc(struct report *, struct report_desc *, int);
    1.23  static void	report_free(struct report *);
    1.24  
    1.25 -#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
    1.26 +#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) || defined(__FreeBSD_kernel__)
    1.27  #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
    1.28  #else
    1.29  #define REP_BUF_DATA(rep) ((rep)->buf->data)
    1.30 @@ -304,7 +304,7 @@
    1.31  		goto usberr;
    1.32  	}
    1.33  	rep = &hw->inreport;
    1.34 -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
    1.35 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__)
    1.36         rep->rid = hid_get_report_id(fd);
    1.37         if (rep->rid < 0) {
    1.38  #else
    1.39 @@ -321,7 +321,7 @@
    1.40  		goto usberr;
    1.41  	}
    1.42  
    1.43 -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
    1.44 +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
    1.45  	hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
    1.46  #else
    1.47  	hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
    1.48 @@ -405,7 +405,7 @@
    1.49  	int nbutton, naxe = -1;
    1.50  	Sint32 v;
    1.51  
    1.52 -#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
    1.53 +#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
    1.54  	struct joystick gameport;
    1.55   
    1.56  	if (joy->hwdata->type == BSDJOY_JOY) {
    1.57 @@ -460,7 +460,7 @@
    1.58  	if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
    1.59  		return;
    1.60  	}
    1.61 -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
    1.62 +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
    1.63  	hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
    1.64  #else
    1.65  	hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);