From 102c69414c2bd5dc23474a156908423e8b820af4 Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Fri, 13 Jul 2012 15:50:04 +0800 Subject: [PATCH] fix failure when building with --disable-debug When building with --disable-debug, VIR_DEBUG expands to a nop. But parameters to VIR_DEBUG can be variables that are passed only to VIR_DEBUG. In the case the building system complains about unused variables. --- src/util/logging.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/util/logging.h b/src/util/logging.h index 70318d04dd..db648cb547 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -1,7 +1,7 @@ /* * logging.h: internal logging and debugging * - * Copyright (C) 2006-2008, 2011 Red Hat, Inc. + * Copyright (C) 2006-2008, 2011-2012 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,8 +34,18 @@ # define VIR_DEBUG_INT(category, f, l, ...) \ virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, __VA_ARGS__) # else +/** + * virLogEatParams: + * + * Do nothing but eat parameters. + */ +static inline void virLogEatParams(const char *unused, ...) +{ + /* Silence gcc */ + unused = unused; +} # define VIR_DEBUG_INT(category, f, l, ...) \ - do { } while (0) + virLogEatParams(category, f, l, __VA_ARGS__) # endif /* !ENABLE_DEBUG */ # define VIR_INFO_INT(category, f, l, ...) \