Commit c650cd747c1d0597487dcf319bf95b5ba775d78b

Authored by Nestro Felipe
Committed by GitHub
1 parent fde672b4

Avoid warning 'libusb_set_debug deprecated' (#55)

Fixes: https://github.com/raspberrypi/usbboot/issues/53
Showing 1 changed file with 8 additions and 0 deletions
@@ -617,7 +617,15 @@ int main(int argc, char *argv[]) @@ -617,7 +617,15 @@ int main(int argc, char *argv[])
617 exit(-1); 617 exit(-1);
618 } 618 }
619 619
  620 +#if LIBUSBX_API_VERSION < 0x01000106
620 libusb_set_debug(ctx, verbose ? LIBUSB_LOG_LEVEL_WARNING : 0); 621 libusb_set_debug(ctx, verbose ? LIBUSB_LOG_LEVEL_WARNING : 0);
  622 +#else
  623 + libusb_set_option(
  624 + ctx,
  625 + LIBUSB_OPTION_LOG_LEVEL,
  626 + verbose ? verbose == 2 ? LIBUSB_LOG_LEVEL_INFO : LIBUSB_LOG_LEVEL_WARNING : 0
  627 + );
  628 +#endif
621 629
622 do 630 do
623 { 631 {