__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 <lha@h5l.org>
AC_MSG_CHECKING([checking for __sync_add_and_fetch])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
- [[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])