summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-01-22 11:45:24 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2020-01-22 11:45:24 -0800
commit521105f92e8e19cf9846a1913fa1e1d225654853 (patch)
treebe5cd20281298781d3e61245457ef725d6395222
parentdf61c0c3a3de070c7f7a714ef8758a248bf97263 (diff)
downloadlibusb-521105f92e8e19cf9846a1913fa1e1d225654853.tar.gz
Misc: Use the UNREFERENCED_PARAMETER macro for UNUSED when available
This will squelch compiler warnings if platform headers provide this. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/libusbi.h6
-rw-r--r--libusb/version_nano.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 6cc36bd..2c574d3 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -91,7 +91,11 @@ extern "C" {
#define USBI_LOG_LINE_END "\n"
/* The following is used to silence warnings for unused variables */
-#define UNUSED(var) do { (void)(var); } while(0)
+#if defined(UNREFERENCED_PARAMETER)
+#define UNUSED(var) UNREFERENCED_PARAMETER(var)
+#else
+#define UNUSED(var) do { (void)(var); } while(0)
+#endif
#if !defined(ARRAYSIZE)
#define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0]))
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 22e41cb..a8068c6 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11437
+#define LIBUSB_NANO 11438