summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-10-29 15:07:11 +0000
committerYann Ylavic <ylavic@apache.org>2021-10-29 15:07:11 +0000
commitf4fc2cafd527f434e9824cb25eeb4615abe0c4f9 (patch)
treed09e9ac585a19d56547c1b1dc8703a6d2115469b /configure.in
parent524ff11d3c7cc5c35ce6c6568cbeb3c9309dc482 (diff)
downloadapr-f4fc2cafd527f434e9824cb25eeb4615abe0c4f9.tar.gz
Revert r1894618.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894619 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in45
1 files changed, 9 insertions, 36 deletions
diff --git a/configure.in b/configure.in
index 3e4be99cc..5fa318306 100644
--- a/configure.in
+++ b/configure.in
@@ -487,7 +487,7 @@ esac
AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins],
[AC_TRY_RUN([
-int main(int argc, const char *const *argv)
+int main()
{
unsigned long val = 1010, tmp, *mem = &val;
@@ -495,6 +495,7 @@ int main(int argc, const char *const *argv)
return 1;
tmp = val;
+
if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010)
return 1;
@@ -502,56 +503,28 @@ int main(int argc, const char *const *argv)
return 1;
tmp = 3030;
+
if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp)
return 1;
- __sync_synchronize();
if (__sync_lock_test_and_set(&val, 4040) != 3030)
return 1;
- if (__sync_val_compare_and_swap(&mem, &val, &tmp) != &val || mem != &tmp)
- return 1;
-
- return 0;
-}], [ap_cv_atomic_builtins=yes], [ap_cv_atomic_builtins=no], [ap_cv_atomic_builtins=no])])
-
-AC_CACHE_CHECK([whether the compiler provides __atomic builtins], [ap_cv__atomic_builtins],
-[AC_TRY_RUN([
-int main(int argc, const char *const *argv)
-{
- unsigned long val = 1010, tmp, *mem = &val, *ptmp;
+ mem = &tmp;
- if (__atomic_fetch_add(&val, 1010, __ATOMIC_SEQ_CST) != 1010 || val != 2020)
+ if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp)
return 1;
- tmp = val;
- if (__atomic_fetch_sub(mem, 1010, __ATOMIC_SEQ_CST) != tmp || val != 1010)
- return 1;
-
- if (__atomic_sub_fetch(&val, 1010, __ATOMIC_SEQ_CST) != 0 || val != 0)
- return 1;
-
- tmp = val;
- if (!__atomic_compare_exchange_n(mem, &tmp, 3030, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
- || tmp != 0)
- return 1;
-
- if (__atomic_exchange_n(&val, 4040, __ATOMIC_SEQ_CST) != 3030)
- return 1;
+ __sync_synchronize();
- ptmp = &val;
- if (!__atomic_compare_exchange_n(&mem, &ptmp, &tmp, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
- || ptmp != &val || mem != &tmp)
+ if (mem != &val)
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], [ap_cv_atomic_builtins=no])])
-if test "$ap_cv_atomic_builtins" = "yes" -o "$ap_cv__atomic_builtins" = "yes"; then
+if test "$ap_cv_atomic_builtins" = "yes"; then
AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
- if test "$ap_cv__atomic_builtins" = "yes"; then
- AC_DEFINE(HAVE__ATOMIC_BUILTINS, 1, [Define if compiler provides __atomic builtins])
- fi
fi
AC_CACHE_CHECK([whether the compiler handles weak symbols], [ap_cv_weak_symbols],