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
This commit is contained in:
Corey Farrell
2018-01-24 19:49:02 -05:00
parent 7ce34f4e6a
commit 6fbd855228
4 changed files with 55 additions and 7 deletions

31
configure vendored
View File

@@ -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