Re: [kvm-devel] [PATCH 5/5] qemu: ARRAY_SIZE redefined

2008-03-28 Thread Carlo Marcelo Arenas Belon
On Fri, Mar 28, 2008 at 10:04:21AM +0300, Avi Kivity wrote:
 Carlo Marcelo Arenas Belon wrote:
 qemu/qemu-kvm-x86.c:23:1: warning: ARRAY_SIZE redefined
 In file included from ../cpu-defs.h:30,
  from 
  
  /var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/target-i386/cpu.h:45,
  from ../qemu-common.h:62,
  from 
  
  /var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/hw/hw.h:5,
  from 
  
  /var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/qemu-kvm-x86.c:13:
 ../osdep.h:30:1: warning: this is the location of the previous definition
 
 Signed-off-by: Carlo Marcelo Arenas Belon [EMAIL PROTECTED]
 ---
  qemu/qemu-kvm-x86.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
 index 78490c5..ab91ff2 100644
 --- a/qemu/qemu-kvm-x86.c
 +++ b/qemu/qemu-kvm-x86.c
 @@ -20,7 +20,9 @@
  
  #define MSR_IA32_TSC0x10
  
 +#ifndef ARRAY_SIZE
  #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 +#endif
  
  static struct kvm_msr_list *kvm_msr_list;
  extern unsigned int kvm_shadow_memory;
 
 Why note remove the definition completely, and #include osdep.h instead?

that was my first choice as there is not even a need to include osdep.h as it
is already included and the source for this conflict.

but ARRAY_SIZE is also defined in qemu in a mips file (mips-dis.c) and
therefore assumed its current state was transitional and having it redefined
as a fallback was safer until consolidated correctly upstream.

Carlo

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel


[kvm-devel] [PATCH 5/5] qemu: ARRAY_SIZE redefined

2008-03-27 Thread Carlo Marcelo Arenas Belon
qemu/qemu-kvm-x86.c:23:1: warning: ARRAY_SIZE redefined
In file included from ../cpu-defs.h:30,
 from 
/var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/target-i386/cpu.h:45,
 from ../qemu-common.h:62,
 from 
/var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/hw/hw.h:5,
 from 
/var/tmp/portage/app-emulation/kvm-64/work/kvm-64/qemu/qemu-kvm-x86.c:13:
../osdep.h:30:1: warning: this is the location of the previous definition

Signed-off-by: Carlo Marcelo Arenas Belon [EMAIL PROTECTED]
---
 qemu/qemu-kvm-x86.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index 78490c5..ab91ff2 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -20,7 +20,9 @@
 
 #define MSR_IA32_TSC   0x10
 
+#ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
 
 static struct kvm_msr_list *kvm_msr_list;
 extern unsigned int kvm_shadow_memory;
-- 
1.5.3.7


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel