libusbi.h: Silence unused context variable warnings when not logging
authorPeter Stuge <peter@stuge.se>
Thu, 22 Sep 2011 08:19:17 +0000 (10:19 +0200)
committerPeter Stuge <peter@stuge.se>
Mon, 17 Oct 2011 14:25:51 +0000 (16:25 +0200)
libusb/libusbi.h

index f1b12d0..fe9b7af 100644 (file)
@@ -132,7 +132,7 @@ void usbi_log(struct libusb_context *ctx, enum usbi_log_level level,
 #ifdef ENABLE_LOGGING
 #define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__)
 #else
-#define _usbi_log(ctx, level, ...) do {} while(0)
+#define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0)
 #endif
 
 #ifdef ENABLE_DEBUG_LOGGING
@@ -159,7 +159,7 @@ void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level,
        va_end(args);             \
 }
 #else
-#define LOG_BODY(ctxt, level) { }
+#define LOG_BODY(ctxt, level) do { (void)(ctxt); } while(0)
 #endif
 
 static inline void usbi_info(struct libusb_context *ctx, const char *format,