From 6fbd85522896c9c94281ed775c98a041721de424 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Wed, 24 Jan 2018 19:49:02 -0500 Subject: Build System: Add support for __atomic built-in operators. Add a check to configure.ac for __atomic_fetch_add support. If found use the __atomic built-in operators for ast_atomic_dec_and_test and ast_atomic_fetchadd_int. ASTERISK~27619 Change-Id: I65b4feb02bae368904ed0fb03f585c05f50a690e --- configure | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 867643ecb..f000c66f1 100755 --- a/configure +++ b/configure @@ -17893,8 +17893,8 @@ fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5 -$as_echo_n "checking for compiler atomic operations... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler sync operations" >&5 +$as_echo_n "checking for compiler sync operations... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17916,6 +17916,33 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5 +$as_echo_n "checking for compiler atomic operations... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_C_ATOMICS 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -- cgit v1.2.3