diff options
author | Han Han <hhan@redhat.com> | 2018-08-02 15:24:39 +0800 |
---|---|---|
committer | Victor Toso <me@victortoso.com> | 2018-08-03 11:06:56 +0200 |
commit | 50cfb1af86d031d25bd2685234e9128807638a0d (patch) | |
tree | cdf15ab9b908bb0c1b6ba2f7030b26795eacb18d /usbredirhost | |
parent | aca0e87db16da1837e07cb52f160f61999745e84 (diff) |
Fix libusb-1.0.22 deprecated libusb_set_debug
Since libusb-1.0.22, libusb_set_debug is deprecated and replaced with
libusb_set_option.
Details:
https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168
Compiling error:
usbredirhost.c: In function ‘usbredirhost_open_full’:
usbredirhost.c:753:5: error: ‘libusb_set_debug’ is deprecated: Use
libusb_set_option instead [-Werror=deprecated-declarations]
libusb_set_debug(host->ctx, host->verbose);
^~~~~~~~~~~~~~~~
Signed-off-by: Han Han <hhan@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'usbredirhost')
-rw-r--r-- | usbredirhost/usbredirhost.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c index 3666227..d55cd5c 100644 --- a/usbredirhost/usbredirhost.c +++ b/usbredirhost/usbredirhost.c @@ -750,7 +750,11 @@ struct usbredirhost *usbredirhost_open_full( usbredirparser_init(host->parser, version, caps, USB_REDIR_CAPS_SIZE, parser_flags); +#if LIBUSB_API_VERSION >= 0x01000106 + libusb_set_option(host->ctx, LIBUSB_OPTION_LOG_LEVEL, host->verbose); +#else libusb_set_debug(host->ctx, host->verbose); +#endif if (usbredirhost_set_device(host, usb_dev_handle) != usb_redir_success) { usbredirhost_close(host); |