Adapted from 215_kfreebsd_gnu.diff SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 09:38:02 +0000
branchSDL-1.2
changeset 4305ecb22f65f0aa
parent 4304 1a0bd446d096
child 4306 aa6aac8a5243
Adapted from 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:28:35 2009 +0000
     1.2 +++ b/include/SDL_platform.h	Sat Oct 10 09:38:02 2009 +0000
     1.3 @@ -47,7 +47,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:28:35 2009 +0000
     2.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sat Oct 10 09:38:02 2009 +0000
     2.3 @@ -306,7 +306,7 @@
     2.4  		goto usberr;
     2.5  	}
     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 @@ -445,7 +445,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 @@ -541,8 +541,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);