windows: Fix build with --disable-log
On Windows we use UNREFERENCED_PARAMETER for UNUSED (commit 521105f).
UNREFERENCED_PARAMETER evaluates to {(ctx) = (ctx);} which errors out:
error: lvalue required as left operand of assignment.
in the cases where ctx is NULL.
Closes #1152
[Tormod: Add ctx reference to avoid unused variable warnings]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index e399666..72d2568 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -322,10 +322,10 @@
#else /* ENABLE_LOGGING */
-#define usbi_err(ctx, ...) UNUSED(ctx)
-#define usbi_warn(ctx, ...) UNUSED(ctx)
-#define usbi_info(ctx, ...) UNUSED(ctx)
-#define usbi_dbg(ctx, ...) do {} while (0)
+#define usbi_err(ctx, ...) do { (void)(ctx); } while(0)
+#define usbi_warn(ctx, ...) do { (void)(ctx); } while(0)
+#define usbi_info(ctx, ...) do { (void)(ctx); } while(0)
+#define usbi_dbg(ctx, ...) do { (void)(ctx); } while(0)
#endif /* ENABLE_LOGGING */
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 69f515c..32a24b1 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11746
+#define LIBUSB_NANO 11747