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 <lha@h5l.org>
This commit is contained in:

committed by
Love Hornquist Astrand

parent
f25c6000fa
commit
7d4b6c3d4d
@@ -490,7 +490,7 @@ AC_CHECK_FUNCS([ \
|
||||
|
||||
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])
|
||||
|
Reference in New Issue
Block a user