diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-10-30 14:14:25 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-30 14:14:25 (GMT) |
| commit | 31368a4f0e531c19affe2a1becd25fc316bc7501 (patch) | |
| tree | 79627d42611a04288b832799204c77b2688f9872 /Include | |
| parent | 9204fb8623896cc5f68ae350784ee25e8a7b2184 (diff) | |
| download | cpython-31368a4f0e531c19affe2a1becd25fc316bc7501.zip cpython-31368a4f0e531c19affe2a1becd25fc316bc7501.tar.gz cpython-31368a4f0e531c19affe2a1becd25fc316bc7501.tar.bz2 | |
bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)
Add pyatomic.h to the VS project (it wasn't referenced).
Diffstat (limited to 'Include')
| -rw-r--r-- | Include/Python.h | 2 | ||||
| -rw-r--r-- | Include/internal/ceval.h | 2 | ||||
| -rw-r--r-- | Include/internal/gil.h | 6 | ||||
| -rw-r--r-- | Include/internal/pyatomic.h (renamed from Include/pyatomic.h) | 13 | ||||
| -rw-r--r-- | Include/internal/pystate.h | 1 |
5 files changed, 15 insertions, 9 deletions
diff --git a/Include/Python.h b/Include/Python.h index 80200fe..cf87a5c 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -53,8 +53,6 @@ #include "pyport.h" #include "pymacro.h" -#include "pyatomic.h" - /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. * PYMALLOC_DEBUG is in error if pymalloc is not in use. */ diff --git a/Include/internal/ceval.h b/Include/internal/ceval.h index cdabb95..4297b5a 100644 --- a/Include/internal/ceval.h +++ b/Include/internal/ceval.h @@ -4,7 +4,7 @@ extern "C" { #endif -#include "pyatomic.h" +#include "internal/pyatomic.h" #include "pythread.h" struct _pending_calls { diff --git a/Include/internal/gil.h b/Include/internal/gil.h index 6139bd2..7743b3f 100644 --- a/Include/internal/gil.h +++ b/Include/internal/gil.h @@ -4,11 +4,11 @@ extern "C" { #endif -#include "pyatomic.h" - #include "internal/condvar.h" +#include "internal/pyatomic.h" + #ifndef Py_HAVE_CONDVAR -#error You need either a POSIX-compatible or a Windows system! +# error You need either a POSIX-compatible or a Windows system! #endif /* Enable if you want to force the switching of threads at least diff --git a/Include/pyatomic.h b/Include/internal/pyatomic.h index 9a497a6..5f349cc 100644 --- a/Include/pyatomic.h +++ b/Include/internal/pyatomic.h @@ -1,6 +1,12 @@ #ifndef Py_ATOMIC_H #define Py_ATOMIC_H -#ifdef Py_BUILD_CORE +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "Py_BUILD_CORE must be defined to include this header" +#endif #include "dynamic_annotations.h" @@ -531,5 +537,8 @@ typedef struct _Py_atomic_int { _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, _Py_memory_order_relaxed) #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) -#endif /* Py_BUILD_CORE */ + +#ifdef __cplusplus +} +#endif #endif /* Py_ATOMIC_H */ diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h index c93dda2..38845d3 100644 --- a/Include/internal/pystate.h +++ b/Include/internal/pystate.h @@ -5,7 +5,6 @@ extern "C" { #endif #include "pystate.h" -#include "pyatomic.h" #include "pythread.h" #include "internal/mem.h" |
