aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-15 17:46:11 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-05-15 14:57:08 -0500
commit8593e050871c632e245190725b11f1e10c629ff2 (patch)
tree3c85eb22e831bd0991320831381e144a540cfd25
parent262f27b93f459ec1dee4100015c109f5e1242091 (diff)
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: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Message-id: 1368632771-4328-1-git-send-email-andreas.faerber@web.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--include/qemu-common.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/qemu-common.h b/include/qemu-common.h
index af769f5ad2..7f18b8e1f9 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -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>