diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-17 21:53:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-17 21:53:27 (GMT) |
commit | 6562b29e13f4da98558636c43a1b242698c8f8d9 (patch) | |
tree | 7258ee9662971eb81dc9d87489091873b3dcc39a /Include/pyatomic.h | |
parent | b28de01992fb2f1ab5c210157f719f74d3ea015a (diff) | |
download | cpython-6562b29e13f4da98558636c43a1b242698c8f8d9.zip cpython-6562b29e13f4da98558636c43a1b242698c8f8d9.tar.gz cpython-6562b29e13f4da98558636c43a1b242698c8f8d9.tar.bz2 |
Issue #23644: Fix issues with C++ when compiling Python extensions
Disable completly pyatomic.h on C++, because <stdatomic.h> is not compatible with C++.
<pyatomic.h> is only needed by the optimized PyThreadState_GET() macro in
pystate.h. Instead, declare PyThreadState_GET() as an alias to
PyThreadState_Get(), as done for limited API.
Diffstat (limited to 'Include/pyatomic.h')
-rw-r--r-- | Include/pyatomic.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Include/pyatomic.h b/Include/pyatomic.h index aa55281..99816a5 100644 --- a/Include/pyatomic.h +++ b/Include/pyatomic.h @@ -1,4 +1,6 @@ -#ifndef Py_LIMITED_API +/* Issue #23644: <stdatomic.h> is incompatible with C++, see: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 */ +#if !defined(Py_LIMITED_API) && !defined(__cplusplus) #ifndef Py_ATOMIC_H #define Py_ATOMIC_H @@ -6,10 +8,6 @@ #include "pyconfig.h" -#ifdef __cplusplus -extern "C" { -#endif - #if defined(HAVE_STD_ATOMIC) #include <stdatomic.h> #endif @@ -250,9 +248,5 @@ _Py_ANNOTATE_MEMORY_ORDER(const volatile void *address, _Py_memory_order order) #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) -#ifdef __cplusplus -} -#endif - #endif /* Py_ATOMIC_H */ #endif /* Py_LIMITED_API */ |