From 4692891d2f62cd96292ce72ed34aed4b85114c41 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 15 Nov 2020 20:42:44 +0100 Subject: [PATCH] Warn if really old libusb The libusb_get_version() function came in libusb(x) 1.0.10, the LIBUSBX_API_VERSION in 1.0.13 about 8 years ago... Signed-off-by: Tormod Volden --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index a9d52df..439d46c 100644 --- a/src/main.c +++ b/src/main.c @@ -354,12 +354,16 @@ int main(int argc, char **argv) exit(0); } +#if defined(LIBUSB_API_VERSION) || defined(LIBUSBX_API_VERSION) if (verbose) { const struct libusb_version *ver; ver = libusb_get_version(); printf("libusb version %i.%i.%i%s (%i)\n", ver->major, ver->minor, ver->micro, ver->rc, ver->nano); } +#else + warnx("libusb version is ancient"); +#endif if (mode == MODE_NONE && !dfuse_options) { fprintf(stderr, "You need to specify one of -D or -U\n");