diff options
author | Corey Farrell <git@cfware.com> | 2018-01-24 19:49:02 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2018-01-24 20:00:48 -0500 |
commit | 6fbd85522896c9c94281ed775c98a041721de424 (patch) | |
tree | a9336ae88416860fc6877837a733d0bb5602e718 /configure | |
parent | 7ce34f4e6a8a2bbfc3cfac9a4465eb0f71372205 (diff) |
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
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -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. */ @@ -17920,6 +17920,33 @@ 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 + # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system printf is NULL-safe." >&5 $as_echo_n "checking if your system printf is NULL-safe.... " >&6; } |