kvm: avoid collision with dprintf macro in stdio.h, spotted by clang

Fixes clang errors:
  CC    i386-softmmu/kvm.o
/src/qemu/target-i386/kvm.c:40:9: error: 'dprintf' macro redefined
In file included from /src/qemu/target-i386/kvm.c:21:
In file included from /src/qemu/qemu-common.h:27:
In file included from /usr/include/stdio.h:910:
/usr/include/bits/stdio2.h:189:12: note: previous definition is here
  CC    i386-softmmu/kvm-all.o
/src/qemu/kvm-all.c:39:9: error: 'dprintf' macro redefined
In file included from /src/qemu/kvm-all.c:23:
In file included from /src/qemu/qemu-common.h:27:
In file included from /usr/include/stdio.h:910:
/usr/include/bits/stdio2.h:189:12: note: previous definition is here

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-04-18 14:22:14 +00:00
parent 6ad6135dca
commit 8c0d577eb5
2 changed files with 25 additions and 25 deletions

View file

@ -34,10 +34,10 @@
//#define DEBUG_KVM
#ifdef DEBUG_KVM
#define dprintf(fmt, ...) \
#define DPRINTF(fmt, ...) \
do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
#else
#define dprintf(fmt, ...) \
#define DPRINTF(fmt, ...) \
do { } while (0)
#endif
@ -957,7 +957,7 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
struct kvm_interrupt intr;
intr.irq = irq;
/* FIXME: errors */
dprintf("injected interrupt %d\n", irq);
DPRINTF("injected interrupt %d\n", irq);
kvm_vcpu_ioctl(env, KVM_INTERRUPT, &intr);
}
}
@ -971,7 +971,7 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
else
run->request_interrupt_window = 0;
dprintf("setting tpr\n");
DPRINTF("setting tpr\n");
run->cr8 = cpu_get_apic_tpr(env);
return 0;
@ -1009,7 +1009,7 @@ int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run)
switch (run->exit_reason) {
case KVM_EXIT_HLT:
dprintf("handle_hlt\n");
DPRINTF("handle_hlt\n");
ret = kvm_handle_halt(env);
break;
}