From: Hu Tao Date: Fri, 13 Jul 2012 07:50:04 +0000 (+0800) Subject: fix failure when building with --disable-debug X-Git-Tag: CVE-2012-3445~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=102c69414c2bd5dc23474a156908423e8b820af4;p=thirdparty%2Flibvirt.git 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. --- 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, ...) \