diff options
| author | 2019-01-28 19:25:11 +0100 | |
|---|---|---|
| committer | 2019-01-28 19:25:11 +0100 | |
| commit | 5da2a0d7d60f79d93c283964888c6fbbc17be1a3 (patch) | |
| tree | f15e2785c9bd2fba4808e4348f79a665c0cb77b1 /src | |
| parent | 1e2ede1f8a972670370c0621d42e54d7cf719766 (diff) | |
| download | libirecovery-5da2a0d7d60f79d93c283964888c6fbbc17be1a3.tar.gz libirecovery-5da2a0d7d60f79d93c283964888c6fbbc17be1a3.tar.bz2 | |
Use new libusb API to set debug level if libusb version is new enough
Diffstat (limited to 'src')
| -rw-r--r-- | src/libirecovery.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) { | |||
| 1664 | #ifndef WIN32 | 1664 | #ifndef WIN32 |
| 1665 | #ifndef HAVE_IOKIT | 1665 | #ifndef HAVE_IOKIT |
| 1666 | if(libirecovery_context) { | 1666 | if(libirecovery_context) { |
| 1667 | #if LIBUSB_API_VERSION >= 0x01000106 | ||
| 1668 | libusb_set_option(libirecovery_context, LIBUSB_OPTION_LOG_LEVEL, libirecovery_debug > 2 ? 1: 0); | ||
| 1669 | #else | ||
| 1667 | libusb_set_debug(libirecovery_context, libirecovery_debug > 2 ? 1: 0); | 1670 | libusb_set_debug(libirecovery_context, libirecovery_debug > 2 ? 1: 0); |
| 1671 | #endif | ||
| 1668 | } | 1672 | } |
| 1669 | #endif | 1673 | #endif |
| 1670 | #endif | 1674 | #endif |
