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>
This commit is contained in:
Chris Dickens
2020-01-22 11:45:24 -08:00
parent df61c0c3a3
commit 521105f92e
2 changed files with 6 additions and 2 deletions

View File

@@ -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]))

View File

@@ -1 +1 @@
#define LIBUSB_NANO 11437
#define LIBUSB_NANO 11438