Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 128937 | Differences between
and this patch

Collapse All | Expand All

(-)libusb-0.1.12/configure.in (-2 / +32 lines)
Lines 90-95 LINUX_API=0 Link Here
90
DARWIN_API=0
90
DARWIN_API=0
91
BSD_API=0
91
BSD_API=0
92
92
93
DEFINE_USB_HID_DESCRIPTOR=1
94
93
AC_MSG_CHECKING(for what USB OS support)
95
AC_MSG_CHECKING(for what USB OS support)
94
case $host in
96
case $host in
95
  *-linux*)
97
  *-linux*)
Lines 101-113 case $host in Link Here
101
    AC_MSG_RESULT(Linux)
103
    AC_MSG_RESULT(Linux)
102
    OSLIBS=""
104
    OSLIBS=""
103
    ;;
105
    ;;
104
  *-freebsd*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*)
106
  *-freebsd*)
107
    AC_DEFINE(BSD_API, 1)
108
    AC_DEFINE(LINUX_API, 0)
109
    AC_DEFINE(DARWIN_API, 0)
110
    BSD_API=1
111
    os_support=bsd
112
    AC_MSG_RESULT(FreeBSD)
113
    OSLIBS=""
114
    AC_CHECK_HEADERS([dev/usb/usbhid.h])
115
    if test "x$ac_cv_header_dev_usb_hisbhid_h" = "xyes"; then
116
    	AC_MSG_CHECKING([for usb_hid_descriptor])
117
	have_usb_hid_descriptor=no
118
	AC_TRY_COMPILE([
119
	  #include <sys/types.h>
120
	  #include <dev/usb/usb.h>
121
	  #include <dev/usb/usbhid.h>
122
	], [
123
	  struct usb_hid_descriptor descr;
124
	], [
125
	  have_usb_hid_descriptor=yes
126
	])
127
	AC_MSG_RESULT([$have_usb_hid_descriptor])
128
	if test "x$have_usb_hid_descriptor" = "xyes"; then
129
	  DEFINE_USB_HID_DESCRIPTOR=0
130
	fi
131
    fi
132
    ;;
133
  *-dragonfly*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*)
105
    AC_DEFINE(BSD_API, 1)
134
    AC_DEFINE(BSD_API, 1)
106
    AC_DEFINE(LINUX_API, 0)
135
    AC_DEFINE(LINUX_API, 0)
107
    AC_DEFINE(DARWIN_API, 0)
136
    AC_DEFINE(DARWIN_API, 0)
108
    BSD_API=1
137
    BSD_API=1
109
    os_support=bsd
138
    os_support=bsd
110
    AC_MSG_RESULT(FreeBSD, OpenBSD and/or NetBSD)
139
    AC_MSG_RESULT(DragonFly, OpenBSD and/or NetBSD)
111
    OSLIBS=""
140
    OSLIBS=""
112
    ;;
141
    ;;
113
  *-darwin*)
142
  *-darwin*)
Lines 128-133 esac Link Here
128
AC_SUBST(DARWIN_API)
157
AC_SUBST(DARWIN_API)
129
AC_SUBST(LINUX_API)
158
AC_SUBST(LINUX_API)
130
AC_SUBST(BSD_API)
159
AC_SUBST(BSD_API)
160
AC_SUBST(DEFINE_USB_HID_DESCRIPTOR)
131
161
132
AM_CONDITIONAL(LINUX_API, test "$os_support" = "linux")
162
AM_CONDITIONAL(LINUX_API, test "$os_support" = "linux")
133
AM_CONDITIONAL(BSD_API, test "$os_support" = "bsd")
163
AM_CONDITIONAL(BSD_API, test "$os_support" = "bsd")
(-)libusb-0.1.12/usb.h.in (+8 lines)
Lines 17-22 Link Here
17
17
18
#include <dirent.h>
18
#include <dirent.h>
19
19
20
#if ! @DEFINE_USB_HID_DESCRIPTOR@ && defined(__FreeBSD__)
21
#include <sys/types.h>
22
#include <dev/usb/usb.h>
23
#include <dev/usb/usbhid.h>
24
#endif
25
20
/*
26
/*
21
 * USB spec information
27
 * USB spec information
22
 *
28
 *
Lines 75-80 struct usb_string_descriptor { Link Here
75
	u_int16_t wData[1];
81
	u_int16_t wData[1];
76
};
82
};
77
83
84
#if ! @DEFINE_USB_HID_DESCRIPTOR@ && defined(__FreeBSD__)
78
/* HID descriptor */
85
/* HID descriptor */
79
struct usb_hid_descriptor {
86
struct usb_hid_descriptor {
80
	u_int8_t  bLength;
87
	u_int8_t  bLength;
Lines 86-91 struct usb_hid_descriptor { Link Here
86
	/* u_int16_t wDescriptorLength; */
93
	/* u_int16_t wDescriptorLength; */
87
	/* ... */
94
	/* ... */
88
};
95
};
96
#endif
89
97
90
/* Endpoint descriptor */
98
/* Endpoint descriptor */
91
#define USB_MAXENDPOINTS	32
99
#define USB_MAXENDPOINTS	32

Return to bug 128937