Adapted from Debian patch: 215_kfreebsd_gnu.diff
authorSam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 09:36:12 +0000
changeset 33668cd9ed45c020
parent 3365 9cd5b35c0184
child 3367 7a7a61a1484d
Adapted from Debian patch: 215_kfreebsd_gnu.diff
include/SDL_platform.h
src/joystick/bsd/SDL_sysjoystick.c
     1.1 --- a/include/SDL_platform.h	Sat Oct 10 09:22:20 2009 +0000
     1.2 +++ b/include/SDL_platform.h	Sat Oct 10 09:36:12 2009 +0000
     1.3 @@ -45,7 +45,7 @@
     1.4  #undef __DREAMCAST__
     1.5  #define __DREAMCAST__	1
     1.6  #endif
     1.7 -#if defined(__FreeBSD__) || defined(__DragonFly__)
     1.8 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
     1.9  #undef __FREEBSD__
    1.10  #define __FREEBSD__	1
    1.11  #endif
     2.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Sat Oct 10 09:22:20 2009 +0000
     2.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sat Oct 10 09:36:12 2009 +0000
     2.3 @@ -309,7 +309,7 @@
     2.4                       hw->path);
     2.5          goto usberr;
     2.6      }
     2.7 -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
     2.8 +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
     2.9      hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
    2.10  #else
    2.11      hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
    2.12 @@ -451,7 +451,7 @@
    2.13      if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
    2.14          return;
    2.15      }
    2.16 -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
    2.17 +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
    2.18      hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
    2.19  #else
    2.20      hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
    2.21 @@ -547,8 +547,8 @@
    2.22  #ifdef __DragonFly__
    2.23      len = hid_report_size(rd, r->rid, repinfo[repind].kind);
    2.24  #elif __FREEBSD__
    2.25 -# if (__FreeBSD_version >= 460000)
    2.26 -#  if (__FreeBSD_version <= 500111)
    2.27 +# if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
    2.28 +#  if (__FreeBSD_kernel_version <= 500111)
    2.29      len = hid_report_size(rd, r->rid, repinfo[repind].kind);
    2.30  #  else
    2.31      len = hid_report_size(rd, repinfo[repind].kind, r->rid);