#include <stdatomic.h>
- _Atomic int value = ATOMIC_VAR_INIT(1);
+ atomic_int value = ATOMIC_VAR_INIT(1);
+ _Atomic void *py_atomic_address = (void*) &value;
int main() {
int loaded_value = atomic_load(&value);
return 0;
[
AC_LANG_SOURCE([[
#include <stdatomic.h>
- _Atomic int value = ATOMIC_VAR_INIT(1);
+ atomic_int value = ATOMIC_VAR_INIT(1);
+ _Atomic void *py_atomic_address = (void*) &value;
int main() {
int loaded_value = atomic_load(&value);
return 0;
AC_MSG_RESULT($have_stdatomic_h)
if test "$have_stdatomic_h" = yes; then
- AC_DEFINE(HAVE_STD_ATOMIC, 1, [Has stdatomic.h])
+ AC_DEFINE(HAVE_STD_ATOMIC, 1,
+ [Has stdatomic.h, atomic_int and _Atomic void* types work])
fi
# Check for GCC >= 4.7 __atomic builtins
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Has stdatomic.h */
+/* Has stdatomic.h, atomic_int and _Atomic void* types work */
#undef HAVE_STD_ATOMIC
/* Define to 1 if you have the `strdup' function. */