src/joystick/bsd/SDL_sysjoystick.c
changeset 6080 eb0e11b096ab
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
     1.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Tue Nov 15 01:38:27 2011 -0500
     1.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Wed Nov 16 05:13:40 2011 -0500
     1.3 @@ -62,6 +62,9 @@
     1.4  #ifndef __DragonFly__
     1.5  #include <osreldate.h>
     1.6  #endif
     1.7 +#if __FreeBSD_kernel_version > 800063
     1.8 +#include <dev/usb/usb_ioctl.h>
     1.9 +#endif
    1.10  #include <sys/joystick.h>
    1.11  #endif
    1.12  
    1.13 @@ -77,16 +80,14 @@
    1.14  #define MAX_JOY_JOYS	2
    1.15  #define MAX_JOYS	(MAX_UHID_JOYS + MAX_JOY_JOYS)
    1.16  
    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 -};
    1.22 -#endif
    1.23  
    1.24  struct report
    1.25  {
    1.26 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
    1.27 +    struct usb_gen_descriptor *buf; /* Buffer */
    1.28 +#else
    1.29      struct usb_ctl_report *buf; /* Buffer */
    1.30 +#endif
    1.31      size_t size;                /* Buffer size */
    1.32      int rid;                    /* Report ID */
    1.33      enum
    1.34 @@ -148,8 +149,10 @@
    1.35  static int report_alloc(struct report *, struct report_desc *, int);
    1.36  static void report_free(struct report *);
    1.37  
    1.38 -#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) || defined(__FreeBSD_kernel__)
    1.39 +#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__)
    1.40  #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
    1.41 +#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
    1.42 +#define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
    1.43  #else
    1.44  #define REP_BUF_DATA(rep) ((rep)->buf->data)
    1.45  #endif