Skip to content

Commit

Permalink
Merge pull request #109 from yann-morin-1998/yem/fixes
Browse files Browse the repository at this point in the history
m4: fix detection of atomics
  • Loading branch information
rgerhards committed Nov 22, 2016
2 parents efb5fac + df08771 commit b839efb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions m4/atomic_operations.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#
AC_DEFUN([RS_ATOMIC_OPERATIONS],
[AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
[AC_TRY_RUN([
int main()
{
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
unsigned long val = 1010, tmp, *mem = &val;
if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020)
Expand Down Expand Up @@ -44,7 +42,7 @@ int main()
return 1;
return 0;
}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])])
]])], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no])])
if test "$ap_cv_atomic_builtins" = "yes"; then
AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
Expand Down
6 changes: 2 additions & 4 deletions m4/atomic_operations_64bit.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#
AC_DEFUN([RS_ATOMIC_OPERATIONS_64BIT],
[AC_CACHE_CHECK([whether the compiler provides atomic builtins for 64 bit data types], [ap_cv_atomic_builtins_64],
[AC_TRY_RUN([
int main()
{
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
unsigned long long val = 1010, tmp, *mem = &val;
if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020)
Expand Down Expand Up @@ -44,7 +42,7 @@ int main()
return 1;
return 0;
}], [ap_cv_atomic_builtins_64=yes], [ap_cv_atomic_builtins_64=no], [ap_cv_atomic_builtins_64=no])])
]])], [ap_cv_atomic_builtins_64=yes], [ap_cv_atomic_builtins_64=no])])
if test "$ap_cv_atomic_builtins_64" = "yes"; then
AC_DEFINE(HAVE_ATOMIC_BUILTINS64, 1, [Define if compiler provides 64 bit atomic builtins])
Expand Down

0 comments on commit b839efb

Please sign in to comment.