From 7d4b6c3d4d9754f1f34f87ff4a2a230538a51c76 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 f88da7822..1ea467a18 100644 --- a/configure.ac +++ b/configure.ac @@ -490,7 +490,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])