Debian patch: 215_kfreebsd_gnu.diff
authorSam Lantinga <slouken@libsdl.org>
Sun, 18 Jul 2010 08:12:28 -0700
changeset 4537cd344ebc14e9
parent 4536 743930106dd7
child 4542 af1d018ebbe6
Debian patch: 215_kfreebsd_gnu.diff
src/joystick/bsd/SDL_sysjoystick.c
     1.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Sun Jul 18 01:04:18 2010 -0700
     1.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sun Jul 18 08:12:28 2010 -0700
     1.3 @@ -59,7 +59,7 @@
     1.4  #include <libusbhid.h>
     1.5  #endif
     1.6  
     1.7 -#ifdef __FREEBSD__
     1.8 +#ifdef 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 @@ -149,7 +149,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 @@ -308,7 +308,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 @@ -324,7 +324,7 @@
    1.40                       hw->path);
    1.41          goto usberr;
    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 @@ -409,7 +409,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      static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0;
    1.56  
    1.57 @@ -466,7 +466,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);