From patchwork Wed May 15 15:46:11 2013 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: 244113 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 AC59F2C009E for ; Thu, 16 May 2013 01:46:37 +1000 (EST) Received: from localhost ([::1]:46644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcduV-0004RG-Nb for incoming@patchwork.ozlabs.org; Wed, 15 May 2013 11:46:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcduF-0004P9-OU for qemu-devel@nongnu.org; Wed, 15 May 2013 11:46:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcduE-0007Ib-6M for qemu-devel@nongnu.org; Wed, 15 May 2013 11:46:19 -0400 Received: from mout.web.de ([212.227.17.11]:61783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcduD-0007Gl-Sk for qemu-devel@nongnu.org; Wed, 15 May 2013 11:46:18 -0400 Received: from envy.com ([195.135.221.2]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MJTYJ-1Ue0gX0O2l-002fDk; Wed, 15 May 2013 17:46:14 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 15 May 2013 17:46:11 +0200 Message-Id: <1368632771-4328-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.8.1.4 MIME-Version: 1.0 X-Provags-ID: V02:K0:LyVuLiAqw8d5gy1s2u2Jv4/U2RPUuPo43LsV+LjuTgQ hb84o+Kqbf17nbn8vrOg9IprmX7eZhNlprz/zFHd9aEfM+4ywH g+QJi9oXgsUEzA1y46SPE1Kv8cY09XraJVANyqlQw1gkcpGKLi SzCZ3yhQhOVceFVdQ4VBGKdGdhJxz0VXFlIkBWL+fahNNwQZdL w6pzGwTipsqliRMgVYL7g== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.11 Cc: pbonzini@redhat.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws Subject: [Qemu-devel] [PATCH buildfix for-1.5] qemu-common: Resolve vector build breakes for AltiVec 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 From: Paolo Bonzini On Mac OS X ppc, altivec.h defines "vector", leading to build breakage when used as variable name, e.g. in tracing code. Fix this by undefining identifiers after altivec.h inclusion. Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- include/qemu-common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index b399d85..9aff292 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -436,12 +436,18 @@ void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); /* vector definitions */ #ifdef __ALTIVEC__ #include -#define VECTYPE vector unsigned char +/* The altivec.h header says we're allowed to undef these for + * C++ compatibility. Here we don't care about C++, but we + * undef them anyway to avoid namespace pollution. + */ +#undef vector +#undef pixel +#undef bool +#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