]> granicus.if.org Git - python/commitdiff
bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)
authorVictor Stinner <vstinner@redhat.com>
Tue, 30 Oct 2018 14:14:25 +0000 (15:14 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Oct 2018 14:14:25 +0000 (15:14 +0100)
Add pyatomic.h to the VS project (it wasn't referenced).

Include/Python.h
Include/internal/ceval.h
Include/internal/gil.h
Include/internal/pyatomic.h [moved from Include/pyatomic.h with 99% similarity]
Include/internal/pystate.h
Makefile.pre.in
Modules/signalmodule.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/ceval_gil.h

index 80200feb9033ea07054ba25780607a10551a23b2..cf87a5ce7a701b036ef1c38c44823bcfc671a293 100644 (file)
@@ -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.
  */
index cdabb9521d1023626b5bed0eeffdf9f7e0f8e5e2..4297b5a51ce42fb763771a0fe6e48930b4a00b99 100644 (file)
@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#include "pyatomic.h"
+#include "internal/pyatomic.h"
 #include "pythread.h"
 
 struct _pending_calls {
index 6139bd215c381197797c40ab53c24249afa9e60c..7743b3f0aa8b76ee39d5edafc52ae15fde3ed085 100644 (file)
@@ -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
similarity index 99%
rename from Include/pyatomic.h
rename to Include/internal/pyatomic.h
index 9a497a683688a9e1349078e646c848bb47b65149..5f349cc3e9e99c531d615c3179ac895d4346c93a 100644 (file)
@@ -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 */
index c93dda28954ae87bea4aa3261cf9873d90b19a17..38845d32ecafab2ff5ae3091d5e83976edddf68b 100644 (file)
@@ -5,7 +5,6 @@ extern "C" {
 #endif
 
 #include "pystate.h"
-#include "pyatomic.h"
 #include "pythread.h"
 
 #include "internal/mem.h"
index 61b469d4504eb36db101374d8ea32a189081116a..232025f1cb6141b1b29d41cb92228fc0026b0d9a 100644 (file)
@@ -988,7 +988,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/pgen.h \
                $(srcdir)/Include/pgenheaders.h \
                $(srcdir)/Include/pyarena.h \
-               $(srcdir)/Include/pyatomic.h \
                $(srcdir)/Include/pycapsule.h \
                $(srcdir)/Include/pyctype.h \
                $(srcdir)/Include/pydebug.h \
@@ -1029,6 +1028,7 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/internal/ceval.h \
                $(srcdir)/Include/internal/gil.h \
                $(srcdir)/Include/internal/mem.h \
+               $(srcdir)/Include/internal/pyatomic.h \
                $(srcdir)/Include/internal/pygetopt.h \
                $(srcdir)/Include/internal/pystate.h \
                $(srcdir)/Include/internal/context.h \
index d1209485827331f92c211dc1072ba44140a0ee16..a81de6ab64622c9d87dbd88b4342f3f9aa5422cc 100644 (file)
@@ -4,6 +4,8 @@
 /* XXX Signals should be recorded per thread, now we have thread state. */
 
 #include "Python.h"
+#include "internal/pyatomic.h"
+
 #ifndef MS_WINDOWS
 #include "posixmodule.h"
 #endif
index cb835390ee1382c87eeaa71e41e65e5fd57ef721..f65bb5b2197c8e15726792c1e7ab8d026e1962c3 100644 (file)
     <ClInclude Include="..\Include\internal\gil.h" />
     <ClInclude Include="..\Include\internal\hamt.h" />
     <ClInclude Include="..\Include\internal\mem.h" />
+    <ClInclude Include="..\Include\internal\pyatomic.h" />
     <ClInclude Include="..\Include\internal\pystate.h" />
     <ClInclude Include="..\Include\internal\warnings.h" />
     <ClInclude Include="..\Include\intrcheck.h" />
index 510a9c2b2e4e100058e7cc0d069bd5e8b4e596e1..7fdadc81676df7798b9dcc9f303fc83d1f3f2f64 100644 (file)
     <ClInclude Include="..\Include\internal\mem.h">
       <Filter>Include</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\internal\pyatomic.h">
+      <Filter>Include</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\internal\pystate.h">
       <Filter>Include</Filter>
     </ClInclude>
index ef5189068e0c9b9c99d2447c5a53c85473bb3639..4a054a97f7108217ef42284b660458e6aa14945a 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include "internal/pyatomic.h"
 
 /* First some general settings */