From fe4ebbfe8d1e318edb3f0498c7d2c1fa73a4fd81 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Mon, 15 Oct 2012 09:16:53 -0700 Subject: [PATCH] Capture return value from __sync_add_and_fetch in the test __sync_add_and_fetch is treated as a built in function by the compiler if the return value is not used (as in the autoconf test), but it is treated as a regular function when the return value is used Signed-off-by: Love Hornquist Astrand --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2f0b42e42..08931d1e3 100644 --- a/configure.ac +++ b/configure.ac @@ -494,7 +494,7 @@ AC_CHECK_FUNCS([ \ AC_MSG_CHECKING([checking for __sync_add_and_fetch]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[unsigned int foo; __sync_add_and_fetch(&foo, 1);]])], + [[unsigned int foo, bar; bar = __sync_add_and_fetch(&foo, 1);]])], [ac_rk_have___sync_add_and_fetch=yes], [ac_rk_have___sync_add_and_fetch=no]) if test "$ac_rk_have___sync_add_and_fetch" = "yes" ; then AC_DEFINE_UNQUOTED(HAVE___SYNC_ADD_AND_FETCH, 1, [have __sync_add_and_fetch]) -- 2.11.4.GIT