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>
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 @@
/* 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 @@
* 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 @@
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