summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-14 15:01:46 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-14 15:01:46 (GMT)
commit923e06f77d7cd3c998913568128e8a41c55136bd (patch)
treed413616596d946940a4d39f409a125c02326cc72
parent3be472b5f777fe5ebc0c1f4b6c0d96c73352db9c (diff)
downloadcpython-923e06f77d7cd3c998913568128e8a41c55136bd.zip
cpython-923e06f77d7cd3c998913568128e8a41c55136bd.tar.gz
cpython-923e06f77d7cd3c998913568128e8a41c55136bd.tar.bz2
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'".
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac6
-rw-r--r--pyconfig.h.in2
3 files changed, 7 insertions, 4 deletions
diff --git a/configure b/configure
index 1ba0e94..ecefde4 100755
--- a/configure
+++ b/configure
@@ -15711,7 +15711,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#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;
diff --git a/configure.ac b/configure.ac
index da096a7..c751622 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4890,7 +4890,8 @@ AC_LINK_IFELSE(
[
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;
@@ -4901,7 +4902,8 @@ AC_LINK_IFELSE(
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 --git a/pyconfig.h.in b/pyconfig.h.in
index 10d5f4a..507a7ab 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -880,7 +880,7 @@
/* 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. */