Skip to content

Commit

Permalink
Warn if really old libusb
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tormodvolden committed Nov 15, 2020
1 parent 6e09e4d commit 4692891
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4692891

Please sign in to comment.