From patchwork Tue May 29 09:59:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 161718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DCFAAB6FB7 for ; Tue, 29 May 2012 19:59:38 +1000 (EST) Received: from localhost ([::1]:33120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZJDE-0002qP-ST for incoming@patchwork.ozlabs.org; Tue, 29 May 2012 05:59:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZJD6-0002pK-QA for qemu-devel@nongnu.org; Tue, 29 May 2012 05:59:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZJD4-00062U-Oo for qemu-devel@nongnu.org; Tue, 29 May 2012 05:59:28 -0400 Received: from mout.web.de ([212.227.15.3]:64184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZJD4-00062C-FR for qemu-devel@nongnu.org; Tue, 29 May 2012 05:59:26 -0400 Received: from localhost.localdomain ([195.135.221.2]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0Lzs0p-1RwU7U3HaF-01546E; Tue, 29 May 2012 11:59:23 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 29 May 2012 11:59:21 +0200 Message-Id: <1338285562-7281-2-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1338285562-7281-1-git-send-email-andreas.faerber@web.de> References: <1338285562-7281-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Provags-ID: V02:K0:/JwMzRwFS34uw2sUgTD/RK+InVXrPuav2N+l1IVXAdi soRtZCIj+IIbAhn9/0Kj8FI/CSEStdk2Uwyl39Qn2KgGhE9xhP OWI1aK/Kh9cd8uF0aKARN/rYOlklyelyPqGCa/xPpMlebjfTY3 lZOX1vSTaeToLk5kB/hifn8GH0uyzCkl/1y+Swk++bm+RiPnKc 052oR2Sj0jJbode7VQjvw== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.15.3 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Subject: [Qemu-devel] [PATCH 1/2] arch_init: Fix AltiVec build on Darwin/ppc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit f29a56147b66845914d0a645bf9b4c5bb9a6af57 (implement -no-user-config command-line option (v3)) introduced uses of bool in arch_init.c. Shortly before that usage is support code for AltiVec (conditional to __ALTIVEC__). GCC's altivec.h may in a !__APPLE_ALTIVEC__ code path redefine bool, leading to type mismatches. altivec.h recommends to #undef for C++ compatibility, but doing so in C leads to bool remaining undefined. Fix by redefining bool to _Bool as mandated for stdbool.h by POSIX. Signed-off-by: Andreas Färber Reviewed-by: Paolo Bonzini --- arch_init.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch_init.c b/arch_init.c index 988adca..a9e8b74 100644 --- a/arch_init.c +++ b/arch_init.c @@ -100,6 +100,10 @@ const uint32_t arch_type = QEMU_ARCH; #define VECTYPE vector unsigned char #define SPLAT(p) vec_splat(vec_ld(0, p), 0) #define ALL_EQ(v1, v2) vec_all_eq(v1, v2) +/* altivec.h may redefine the bool macro as vector type. + * Reset it to POSIX semantics. */ +#undef bool +#define bool _Bool #elif defined __SSE2__ #include #define VECTYPE __m128i