Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 923e06f

Browse files
committed
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'".
1 parent 3be472b commit 923e06f

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15711,7 +15711,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1571115711
1571215712
1571315713
#include <stdatomic.h>
15714-
_Atomic int value = ATOMIC_VAR_INIT(1);
15714+
atomic_int value = ATOMIC_VAR_INIT(1);
15715+
_Atomic void *py_atomic_address = (void*) &value;
1571515716
int main() {
1571615717
int loaded_value = atomic_load(&value);
1571715718
return 0;

configure.ac

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4890,7 +4890,8 @@ AC_LINK_IFELSE(
48904890
[
48914891
AC_LANG_SOURCE([[
48924892
#include <stdatomic.h>
4893-
_Atomic int value = ATOMIC_VAR_INIT(1);
4893+
atomic_int value = ATOMIC_VAR_INIT(1);
4894+
_Atomic void *py_atomic_address = (void*) &value;
48944895
int main() {
48954896
int loaded_value = atomic_load(&value);
48964897
return 0;
@@ -4901,7 +4902,8 @@ AC_LINK_IFELSE(
49014902
AC_MSG_RESULT($have_stdatomic_h)
49024903

49034904
if test "$have_stdatomic_h" = yes; then
4904-
AC_DEFINE(HAVE_STD_ATOMIC, 1, [Has stdatomic.h])
4905+
AC_DEFINE(HAVE_STD_ATOMIC, 1,
4906+
[Has stdatomic.h, atomic_int and _Atomic void* types work])
49054907
fi
49064908

49074909
# Check for GCC >= 4.7 __atomic builtins

pyconfig.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@
880880
/* Define to 1 if you have the <stdlib.h> header file. */
881881
#undef HAVE_STDLIB_H
882882

883-
/* Has stdatomic.h */
883+
/* Has stdatomic.h, atomic_int and _Atomic void* types work */
884884
#undef HAVE_STD_ATOMIC
885885

886886
/* Define to 1 if you have the `strdup' function. */

0 commit comments

Comments
 (0)