diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2021-10-02 00:05:32 +0200 |
---|---|---|
committer | Nathan Hjelm <hjelmn@me.com> | 2021-11-27 10:04:05 -0700 |
commit | 33d9949921423d0911527e04af8372d320f2489b (patch) | |
tree | b274ce4e2854a7d33626365e0ff801e2a78db5fa | |
parent | 143a33744f7b1b6296ea105879b83adc92585e3f (diff) | |
download | libusb-33d9949921423d0911527e04af8372d320f2489b.tar.gz |
Keep LIBUSB_OPTION_WEAK_AUTHORITY as a macro with same value
If the value is always the same we retain binary compatibility.
References #935
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
-rw-r--r-- | libusb/core.c | 1 | ||||
-rw-r--r-- | libusb/libusb.h | 10 | ||||
-rw-r--r-- | libusb/os/linux_usbfs.c | 3 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
4 files changed, 6 insertions, 10 deletions
diff --git a/libusb/core.c b/libusb/core.c index 8ebf08b..7893ac2 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -2229,7 +2229,6 @@ int API_EXPORTED libusb_set_option(libusb_context *ctx, /* Handle all backend-specific options here */ case LIBUSB_OPTION_USE_USBDK: case LIBUSB_OPTION_NO_DEVICE_DISCOVERY: - case LIBUSB_OPTION_WEAK_AUTHORITY: if (usbi_backend.set_option) return usbi_backend.set_option(ctx, option, ap); diff --git a/libusb/libusb.h b/libusb/libusb.h index 7ec3fcf..53aeec5 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -2115,17 +2115,15 @@ enum libusb_option { * This is typically needed on Android, where access to USB devices * is limited. * + * For LIBUSB_API_VERSION 0x01000108 it was called LIBUSB_OPTION_WEAK_AUTHORITY + * * Only valid on Linux. */ LIBUSB_OPTION_NO_DEVICE_DISCOVERY = 2, - /** Flag that libusb has weak authority. - * - * (Deprecated) alias for LIBUSB_OPTION_NO_DEVICE_DISCOVERY - */ - LIBUSB_OPTION_WEAK_AUTHORITY = 3, +#define LIBUSB_OPTION_WEAK_AUTHORITY LIBUSB_OPTION_NO_DEVICE_DISCOVERY - LIBUSB_OPTION_MAX = 4 + LIBUSB_OPTION_MAX = 3 }; int LIBUSB_CALL libusb_set_option(libusb_context *ctx, enum libusb_option option, ...); diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index 1888c92..c300675 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -439,8 +439,7 @@ static int op_set_option(struct libusb_context *ctx, enum libusb_option option, UNUSED(ctx); UNUSED(ap); - if (option == LIBUSB_OPTION_NO_DEVICE_DISCOVERY || - option == LIBUSB_OPTION_WEAK_AUTHORITY) { + if (option == LIBUSB_OPTION_NO_DEVICE_DISCOVERY) { usbi_dbg(ctx, "no enumeration will be performed"); no_enumeration = 1; return LIBUSB_SUCCESS; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index d5d1fd2..ff0c997 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11676 +#define LIBUSB_NANO 11678 |