Permalink
Browse files

correctly detect presence of __sync_and_fetch

  • Loading branch information...
1 parent b8e6e0c commit 8ac6841c4c4857acddd87bdb4dfafb729aea91c3 @unicolet unicolet committed Oct 18, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 configure
  2. +1 −1 configure.in
View
@@ -17836,7 +17836,7 @@ else
int
main ()
{
-int x;__sync_fetch_and_add(&x,1);
+long x;long y=__sync_fetch_and_add(&x,1);
;
return 0;
}
View
@@ -851,7 +851,7 @@ dnl ---------------------------------------------------------------------
dnl Check for the __sync_fetch_and_add builtin
dnl ---------------------------------------------------------------------
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
-[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
+[AC_TRY_LINK([],[long x;long y=__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
ALL_ENABLED="-DHAVE_SYNC_FETCH_AND_ADD $ALL_ENABLED"
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])

0 comments on commit 8ac6841

Please sign in to comment.