summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-16 17:33:26 -0500
committermidipix <writeonce@midipix.org>2018-12-18 20:38:40 -0500
commite9a8e5e05df2ea39d3a9f5823f78b668402d04fb (patch)
treee02259d3881bda59570b915a6a1b0fb4d9dfa266
parent6a0fd86079c92d04e2d66e61a9127373a1530328 (diff)
downloadsbpython3-e9a8e5e05df2ea39d3a9f5823f78b668402d04fb.tar.bz2
sbpython3-e9a8e5e05df2ea39d3a9f5823f78b668402d04fb.tar.xz
custom config, modern.h: properly detect stdatomic.h and atomic built-ins.
-rw-r--r--profiles/osapi/modern.h11
-rw-r--r--project/config/cfgdefs.sh1
2 files changed, 10 insertions, 2 deletions
diff --git a/profiles/osapi/modern.h b/profiles/osapi/modern.h
index 32fc82a..f8c788d 100644
--- a/profiles/osapi/modern.h
+++ b/profiles/osapi/modern.h
@@ -1,6 +1,15 @@
#ifndef PY_OSAPI_MODERN_H
#define PY_OSAPI_MODERN_H
+/* atomics */
+#ifdef __ATOMIC_ACQUIRE
+#define HAVE_BUILTIN_ATOMIC 1
+#endif
+
+#ifdef HAVE_STDATOMIC_H
+#define HAVE_STD_ATOMIC 1
+#endif
+
/* stdc headers */
#define STDC_HEADERS 1
@@ -57,7 +66,6 @@
#define HAVE_ASINH 1
#define HAVE_ATANH 1
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
-#define HAVE_BUILTIN_ATOMIC 1
#define HAVE_CHOWN 1
#define HAVE_CHROOT 1
#define HAVE_CLOCK 1
@@ -227,7 +235,6 @@
#define HAVE_STATVFS 1
#define HAVE_STAT_TV_NSEC 1
#define HAVE_STDARG_PROTOTYPES 1
-#define HAVE_STD_ATOMIC 1
#define HAVE_STRDUP 1
#define HAVE_STRFTIME 1
#define HAVE_STRLCPY 1
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 567e6cf..750de3a 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -80,6 +80,7 @@ cfgdefs_perform_common_tests()
{
# headers
cfgtest_header_absence 'stropts.h'
+ cfgtest_header_presence 'stdatomic.h'
cfgtest_header_presence 'endian.h'
cfgtest_header_presence 'net/if.h'
cfgtest_header_presence 'sched.h'