FreeBSD's libusb-1.0 compatible library has a few differences compared
to the "normal" libusb-1.0 from libusb.org which we have to work around.
LIBUSB_CLASS_APPLICATION doesn't exist in FreeBSD's libusb, and
libusb_handle_events_timeout_completed() doesn't exist either.
The latter is basically libusb_handle_events_timeout() with an extra
(unused by us) parameter, so the workaround is relatively simple.
This fixes bug #185.
#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
#endif
+/* Portability fixes for FreeBSD. */
+#ifdef __FreeBSD__
+#define LIBUSB_CLASS_APPLICATION 0xfe
+#define libusb_handle_events_timeout_completed(ctx, tv, c) \
+ libusb_handle_events_timeout(ctx, tv)
+#endif
+
struct sr_context {
#ifdef HAVE_LIBUSB_1_0
libusb_context *libusb_ctx;