From f992d201ad955340e404e076c7cd227ad5413ce3 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 5 Dec 2017 21:11:35 +0100 Subject: [PATCH] Simplify the conditional compilation Move the global variables inside an existing conditionally compiled block, to remove some of the #ifdef's. --- src/usbhid.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/usbhid.c b/src/usbhid.c index c9435c8..dab5efe 100644 --- a/src/usbhid.c +++ b/src/usbhid.c @@ -107,6 +107,12 @@ static const dc_iostream_vtable_t dc_usbhid_vtable = { dc_usbhid_close, /* close */ }; +static dc_mutex_t g_usbhid_mutex = DC_MUTEX_INIT; +static size_t g_usbhid_refcount = 0; +#ifdef USE_LIBUSB +static libusb_context *g_usbhid_ctx = NULL; +#endif + #if defined(USE_LIBUSB) static dc_status_t syserror(int errcode) @@ -129,14 +135,6 @@ syserror(int errcode) } } #endif -#endif - -#ifdef USBHID -static dc_mutex_t g_usbhid_mutex = DC_MUTEX_INIT; -static size_t g_usbhid_refcount = 0; -#ifdef USE_LIBUSB -static libusb_context *g_usbhid_ctx = NULL; -#endif static void dc_mutex_lock (dc_mutex_t *mutex)