From 5da2a0d7d60f79d93c283964888c6fbbc17be1a3 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 28 Jan 2019 19:25:11 +0100 Subject: Use new libusb API to set debug level if libusb version is new enough --- src/libirecovery.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libirecovery.c b/src/libirecovery.c index 02d0075..cd247ad 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -1664,7 +1664,11 @@ IRECV_API void irecv_set_debug_level(int level) { #ifndef WIN32 #ifndef HAVE_IOKIT if(libirecovery_context) { +#if LIBUSB_API_VERSION >= 0x01000106 + libusb_set_option(libirecovery_context, LIBUSB_OPTION_LOG_LEVEL, libirecovery_debug > 2 ? 1: 0); +#else libusb_set_debug(libirecovery_context, libirecovery_debug > 2 ? 1: 0); +#endif } #endif #endif -- cgit v1.1-32-gdbae