Adapted from Debian patch: 215_kfreebsd_gnu.diff
authorSam Lantinga <slouken@libsdl.org>
Sat, 10 Oct 2009 09:36:12 +0000
changeset 3366 8cd9ed45c020
parent 3365 9cd5b35c0184
child 3367 7a7a61a1484d
Adapted from Debian patch: 215_kfreebsd_gnu.diff
include/SDL_platform.h
src/joystick/bsd/SDL_sysjoystick.c
--- a/include/SDL_platform.h	Sat Oct 10 09:22:20 2009 +0000
+++ b/include/SDL_platform.h	Sat Oct 10 09:36:12 2009 +0000
@@ -45,7 +45,7 @@
 #undef __DREAMCAST__
 #define __DREAMCAST__	1
 #endif
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #undef __FREEBSD__
 #define __FREEBSD__	1
 #endif
--- a/src/joystick/bsd/SDL_sysjoystick.c	Sat Oct 10 09:22:20 2009 +0000
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Sat Oct 10 09:36:12 2009 +0000
@@ -309,7 +309,7 @@
                      hw->path);
         goto usberr;
     }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
     hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
 #else
     hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
@@ -451,7 +451,7 @@
     if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
         return;
     }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
     hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
 #else
     hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
@@ -547,8 +547,8 @@
 #ifdef __DragonFly__
     len = hid_report_size(rd, r->rid, repinfo[repind].kind);
 #elif __FREEBSD__
-# if (__FreeBSD_version >= 460000)
-#  if (__FreeBSD_version <= 500111)
+# if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
+#  if (__FreeBSD_kernel_version <= 500111)
     len = hid_report_size(rd, r->rid, repinfo[repind].kind);
 #  else
     len = hid_report_size(rd, repinfo[repind].kind, r->rid);