changeset: 94138:dacc944641b1 parent: 94136:c917ba25c007 user: Victor Stinner date: Wed Jan 14 16:01:46 2015 +0100 files: configure configure.ac pyconfig.h.in description: Issue #22038, configure: HAVE_STD_ATOMIC now also check that "atomic_int" and "_Atomic void*" types work. Change needed on FreeBSD 10 where stdatomic.h is available but the compiler fails on "_Atomic void*" with "_Atomic cannot be applied to incomplete type 'void'". diff -r c917ba25c007 -r dacc944641b1 configure --- a/configure Wed Jan 14 08:26:30 2015 +0100 +++ b/configure Wed Jan 14 16:01:46 2015 +0100 @@ -15711,7 +15711,8 @@ #include - _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; diff -r c917ba25c007 -r dacc944641b1 configure.ac --- a/configure.ac Wed Jan 14 08:26:30 2015 +0100 +++ b/configure.ac Wed Jan 14 16:01:46 2015 +0100 @@ -4890,7 +4890,8 @@ [ AC_LANG_SOURCE([[ #include - _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; @@ -4901,7 +4902,8 @@ 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 diff -r c917ba25c007 -r dacc944641b1 pyconfig.h.in --- a/pyconfig.h.in Wed Jan 14 08:26:30 2015 +0100 +++ b/pyconfig.h.in Wed Jan 14 16:01:46 2015 +0100 @@ -880,7 +880,7 @@ /* Define to 1 if you have the 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. */