Let the compiler print a comprehensible error message if it does not provide built-in functions for atomic memory access.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8284 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/tests/tc11_XCHG.c b/helgrind/tests/tc11_XCHG.c
index 1d9df4c..28ef783 100644
--- a/helgrind/tests/tc11_XCHG.c
+++ b/helgrind/tests/tc11_XCHG.c
@@ -1,4 +1,5 @@
+#include "config.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -47,6 +48,7 @@
)
#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \
|| defined(PLAT_ppc32_aix5) || defined(PLAT_ppc64_aix5)
+#ifdef HAVE_BUILTIN_ATOMIC
# define XCHG_M_R(_addr,_lval) \
do { \
int tmp; \
@@ -55,6 +57,9 @@
; \
_lval = tmp; \
} while (0)
+#else
+#error "XCHG_M_R() implementation is missing. Either provide one or use a newer gcc version."
+#endif
# define XCHG_M_R_with_redundant_LOCK(_addr,_lval) \
XCHG_M_R(_addr,_lval)
#else