forked from Imagelibrary/rtems
add compare_and_swap check in check-atomic.m4
This commit is contained in:
@@ -7,9 +7,11 @@ AC_CACHE_CHECK([whether CPU supports atomic operations],
|
||||
[rtems_cv_ATOMIC],[
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <stdatomic.h>]],
|
||||
[[atomic_uint_fast32_t t; atomic_init(&t, 0);
|
||||
[[atomic_uint_fast32_t t; uint_fast32_t m = 1;
|
||||
atomic_init(&t, 0);
|
||||
atomic_store( &t, 1 );
|
||||
atomic_exchange( &t, 2 );
|
||||
atomic_compare_exchange_strong( &t, &m, 2);
|
||||
atomic_fetch_add( &t, 3 );]])],
|
||||
[rtems_cv_ATOMIC="yes"],
|
||||
[rtems_cv_ATOMIC="no"])
|
||||
|
||||
Reference in New Issue
Block a user