aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-06-03 16:23:41 +0200
committerHarald Welte <laforge@gnumonks.org>2018-06-03 16:25:32 +0200
commit79908e1109e6de0e8703629a95041cc504aa2a6d (patch)
tree61c7978f78224f68e9895586b107240622f0b806
parentd5c4dcc59750052a1a95b5185aca3548a5b951de (diff)
libusb-1.0.22 deprecated libusb_set_debug() with libusb_set_option()
This avoids the following compiler warnings when using more recent versions of libusb: src/libosmo-fl2k.c:384:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations] libusb_set_debug(dev->ctx, 3); ^~~~~~~~~~~~~~~~ Details can be found at https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168
-rw-r--r--src/libosmo-fl2k.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libosmo-fl2k.c b/src/libosmo-fl2k.c
index 0285f9a..9116aff 100644
--- a/src/libosmo-fl2k.c
+++ b/src/libosmo-fl2k.c
@@ -381,7 +381,11 @@ int fl2k_open(fl2k_dev_t **out_dev, uint32_t index)
return -1;
}
+#if LIBUSB_API_VERSION >= 0x01000106
+ libusb_set_option(dev->ctx, LIBUSB_OPTION_LOG_LEVEL, 3);
+#else
libusb_set_debug(dev->ctx, 3);
+#endif
dev->dev_lost = 1;