From 0d8d6a24fc32c54359606d957d8acbe98b7be9c9 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 10 Jan 2019 08:09:13 +0100 Subject: ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode When compiling the ppc code with clang and -std=gnu99, there are a couple of warnings/errors like this one: CC ppc64-softmmu/hw/intc/xics.o In file included from hw/intc/xics.c:35: include/hw/ppc/xics.h:43:25: error: redefinition of typedef 'ICPState' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef struct ICPState ICPState; ^ target/ppc/cpu.h:1181:25: note: previous definition is here typedef struct ICPState ICPState; ^ Work around the problems by including the proper headers in spapr.h and by using struct forward declarations in cpu.h. Reviewed-by: Greg Kurz Signed-off-by: Thomas Huth --- target/ppc/cpu.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'target') diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 486abaf99b..a62ff60414 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1177,8 +1177,9 @@ do { \ typedef struct PPCVirtualHypervisor PPCVirtualHypervisor; typedef struct PPCVirtualHypervisorClass PPCVirtualHypervisorClass; -typedef struct XiveTCTX XiveTCTX; -typedef struct ICPState ICPState; + +struct XiveTCTX; +struct ICPState; /** * PowerPCCPU: @@ -1197,8 +1198,8 @@ struct PowerPCCPU { int vcpu_id; uint32_t compat_pvr; PPCVirtualHypervisor *vhyp; - ICPState *icp; - XiveTCTX *tctx; + struct ICPState *icp; + struct XiveTCTX *tctx; void *machine_data; int32_t node_id; /* NUMA node this CPU belongs to */ PPCHash64Options *hash64_opts; -- cgit v1.2.3-55-g7522