From: Uwe Hermann Date: Mon, 28 Oct 2013 21:59:32 +0000 (+0100) Subject: Fix two FreeBSD build issues related to libusb-1.0. X-Git-Tag: libsigrok-0.2.2~21 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=6bf4273ee8bb6477ba55e0540e370547bd804641 Fix two FreeBSD build issues related to libusb-1.0. 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. --- diff --git a/libsigrok-internal.h b/libsigrok-internal.h index a2d9a5a1..95978b20 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -43,6 +43,13 @@ #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;