]> granicus.if.org Git - python/commitdiff
Issue #22038, configure: HAVE_STD_ATOMIC now also check that "atomic_int" and
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Jan 2015 15:01:46 +0000 (16:01 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 14 Jan 2015 15:01:46 +0000 (16:01 +0100)
"_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'".

configure
configure.ac
pyconfig.h.in

index 1ba0e9410fc2f347a9add78308e8b2eb5810e03b..ecefde4cfb9be70224193a100ce60fd861061ec7 100755 (executable)
--- 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;
index da096a7c883c3166766ffbb9d2543383ba9f1f2c..c7516225fafa89435ab0bdf29a6f4ff867081536 100644 (file)
@@ -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
index 10d5f4a5f4bc61587449ed7fceeb26d24434ebad..507a7ab18326b0d7313d5f9b313254be533ace8c 100644 (file)
 /* 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. */