提交 8593e050 编写于 作者: P Paolo Bonzini 提交者: Anthony Liguori

qemu-common: Resolve vector build breakes for AltiVec

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: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAndreas Färber <andreas.faerber@web.de>
Message-id: 1368632771-4328-1-git-send-email-andreas.faerber@web.de
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 262f27b9
......@@ -448,12 +448,18 @@ void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size);
/* vector definitions */
#ifdef __ALTIVEC__
#include <altivec.h>
#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 <emmintrin.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册