mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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:
31
configure
vendored
31
configure
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user