提交 f283edc4 编写于 作者: A Andreas Färber 提交者: Andreas Färber

arch_init: Fix AltiVec build on Darwin/ppc

Commit f29a5614 (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: NAndreas Färber <andreas.faerber@web.de>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 24f50d7e
...@@ -100,6 +100,10 @@ const uint32_t arch_type = QEMU_ARCH; ...@@ -100,6 +100,10 @@ const uint32_t arch_type = QEMU_ARCH;
#define VECTYPE vector unsigned char #define VECTYPE vector unsigned char
#define SPLAT(p) vec_splat(vec_ld(0, p), 0) #define SPLAT(p) vec_splat(vec_ld(0, p), 0)
#define ALL_EQ(v1, v2) vec_all_eq(v1, v2) #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__ #elif defined __SSE2__
#include <emmintrin.h> #include <emmintrin.h>
#define VECTYPE __m128i #define VECTYPE __m128i
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册