mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
build: avoid gcc preprocessor extensions
Use of ',##__VA_ARGS__' is a gcc extension not guaranteed by C99; thankfully, we can avoid it by lumping the format argument into the var-args set. * src/util/logging.h (VIR_DEBUG_INT, VIR_INFO_INT, VIR_WARN_INT) (VIR_ERROR_INT, VIR_DEBUG, VIR_INFO, VIR_WARN, VIR_ERROR): Stick to C99 var-arg macro syntax. * examples/domain-events/events-c/event-test.c (VIR_DEBUG): Simplify.
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
#include <libvirt/libvirt.h>
|
||||
#include <libvirt/virterror.h>
|
||||
|
||||
#define VIR_DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
|
||||
__func__, __LINE__, ##__VA_ARGS__)
|
||||
#define VIR_DEBUG(fmt) printf("%s:%d: " fmt "\n", __func__, __LINE__)
|
||||
#define STREQ(a,b) (strcmp(a,b) == 0)
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
|
||||
Reference in New Issue
Block a user