]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Let the compiler print a comprehensible error message if it does not provide built...
authorBart Van Assche <bvanassche@acm.org>
Thu, 26 Jun 2008 08:58:25 +0000 (08:58 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 26 Jun 2008 08:58:25 +0000 (08:58 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8284

helgrind/tests/tc11_XCHG.c

index 1d9df4c281b5de64216321cb48e15f7c7cd3acca..28ef78383bd54dac5abbcd391b69498b83e32513 100644 (file)
@@ -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