mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
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.
This commit is contained in:
parent
ece765959a
commit
102c69414c
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* logging.h: internal logging and debugging
|
* 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
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -34,8 +34,18 @@
|
|||||||
# define VIR_DEBUG_INT(category, f, l, ...) \
|
# define VIR_DEBUG_INT(category, f, l, ...) \
|
||||||
virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, __VA_ARGS__)
|
virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, __VA_ARGS__)
|
||||||
# else
|
# 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, ...) \
|
# define VIR_DEBUG_INT(category, f, l, ...) \
|
||||||
do { } while (0)
|
virLogEatParams(category, f, l, __VA_ARGS__)
|
||||||
# endif /* !ENABLE_DEBUG */
|
# endif /* !ENABLE_DEBUG */
|
||||||
|
|
||||||
# define VIR_INFO_INT(category, f, l, ...) \
|
# define VIR_INFO_INT(category, f, l, ...) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user