[Python-checkins] bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271)

Victor Stinner webhook-mailer at python.org
Wed Oct 31 21:30:41 EDT 2018


https://github.com/python/cpython/commit/e281f7d80ce2584a7e6a36acffb5a9cd796a0fe2
commit: e281f7d80ce2584a7e6a36acffb5a9cd796a0fe2
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-11-01T02:30:36+01:00
summary:

bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271)

The accu.h header is no longer part of the Python C API: it has been
moved to the "internal" headers which are restricted to Python
itself.

Replace #include "accu.h" with #include "pycore_accu.h".

files:
A Include/internal/pycore_accu.h
D Include/accu.h
M Makefile.pre.in
M Modules/_io/stringio.c
M Modules/_json.c
M Objects/accu.c
M Objects/listobject.c
M Objects/tupleobject.c
M PCbuild/pythoncore.vcxproj
M PCbuild/pythoncore.vcxproj.filters

diff --git a/Include/accu.h b/Include/internal/pycore_accu.h
similarity index 88%
rename from Include/accu.h
rename to Include/internal/pycore_accu.h
index 3636ea6c98fd..ab1aad280346 100644
--- a/Include/accu.h
+++ b/Include/internal/pycore_accu.h
@@ -1,6 +1,9 @@
 #ifndef Py_LIMITED_API
-#ifndef Py_ACCU_H
-#define Py_ACCU_H
+#ifndef Py_INTERNAL_ACCU_H
+#define Py_INTERNAL_ACCU_H
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*** This is a private API for use by the interpreter and the stdlib.
  *** Its definition may be changed or removed at any moment.
@@ -12,10 +15,6 @@
  * behaviour of using a naive repeated concatenation scheme.
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #undef small /* defined by some Windows headers */
 
 typedef struct {
@@ -32,6 +31,5 @@ PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc);
 #ifdef __cplusplus
 }
 #endif
-
-#endif /* Py_ACCU_H */
-#endif /* Py_LIMITED_API */
+#endif /* !Py_INTERNAL_ACCU_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0336290dd841..fc8b1e4e7334 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -935,7 +935,6 @@ regen-typeslots:
 PYTHON_HEADERS= \
 		$(srcdir)/Include/Python.h \
 		$(srcdir)/Include/abstract.h \
-		$(srcdir)/Include/accu.h \
 		$(srcdir)/Include/asdl.h \
 		$(srcdir)/Include/ast.h \
 		$(srcdir)/Include/bltinmodule.h \
@@ -1025,6 +1024,7 @@ PYTHON_HEADERS= \
 		pyconfig.h \
 		$(PARSER_HEADERS) \
 		$(srcdir)/Include/Python-ast.h \
+		$(srcdir)/Include/internal/pycore_accu.h \
 		$(srcdir)/Include/internal/pycore_atomic.h \
 		$(srcdir)/Include/internal/pycore_ceval.h \
 		$(srcdir)/Include/internal/pycore_context.h \
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index 5a03715fbde0..793fa1ee150b 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -1,7 +1,7 @@
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
-#include "accu.h"
+#include "pycore_accu.h"
 #include "_iomodule.h"
 
 /* Implementation note: the buffer is always at least one character longer
diff --git a/Modules/_json.c b/Modules/_json.c
index ac6e017a4eaf..53e1e88fa4bf 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -7,7 +7,7 @@
 
 #include "Python.h"
 #include "structmember.h"
-#include "accu.h"
+#include "pycore_accu.h"
 
 #ifdef __GNUC__
 #define UNUSED __attribute__((__unused__))
diff --git a/Objects/accu.c b/Objects/accu.c
index 48fe02da5409..c8b5d382e388 100644
--- a/Objects/accu.c
+++ b/Objects/accu.c
@@ -1,7 +1,7 @@
 /* Accumulator struct implementation */
 
 #include "Python.h"
-#include "accu.h"
+#include "pycore_accu.h"
 
 static PyObject *
 join_list_unicode(PyObject *lst)
diff --git a/Objects/listobject.c b/Objects/listobject.c
index e38b21f2a30b..ffd91a63e323 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2,7 +2,7 @@
 
 #include "Python.h"
 #include "pycore_state.h"
-#include "accu.h"
+#include "pycore_accu.h"
 
 #ifdef STDC_HEADERS
 #include <stddef.h>
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index cce266f7a2d2..c997bc6fa2d0 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -3,7 +3,7 @@
 
 #include "Python.h"
 #include "pycore_state.h"
-#include "accu.h"
+#include "pycore_accu.h"
 
 /*[clinic input]
 class tuple "PyTupleObject *" "&PyTuple_Type"
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index ebc35a7c0049..6becb8a3682c 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -79,7 +79,6 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\Include\abstract.h" />
-    <ClInclude Include="..\Include\accu.h" />
     <ClInclude Include="..\Include\asdl.h" />
     <ClInclude Include="..\Include\ast.h" />
     <ClInclude Include="..\Include\bitset.h" />
@@ -112,6 +111,7 @@
     <ClInclude Include="..\Include\graminit.h" />
     <ClInclude Include="..\Include\grammar.h" />
     <ClInclude Include="..\Include\import.h" />
+    <ClInclude Include="..\Include\internal\pycore_accu.h" />
     <ClInclude Include="..\Include\internal\pycore_atomic.h" />
     <ClInclude Include="..\Include\internal\pycore_ceval.h" />
     <ClInclude Include="..\Include\internal\pycore_condvar.h" />
@@ -154,7 +154,6 @@
     <ClInclude Include="..\Include\pyerrors.h" />
     <ClInclude Include="..\Include\pyexpat.h" />
     <ClInclude Include="..\Include\pyfpe.h" />
-    <ClInclude Include="..\Include\internal\pygetopt.h" />
     <ClInclude Include="..\Include\pylifecycle.h" />
     <ClInclude Include="..\Include\pymath.h" />
     <ClInclude Include="..\Include\pytime.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 052c89cf806c..bc118c636cde 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -36,9 +36,6 @@
     <ClInclude Include="..\Include\abstract.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\accu.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\asdl.h">
       <Filter>Include</Filter>
     </ClInclude>
@@ -135,6 +132,9 @@
     <ClInclude Include="..\Include\import.h">
       <Filter>Include</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\internal\pycore_accu.h">
+      <Filter>Include</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\internal\pycore_atomic.h">
       <Filter>Include</Filter>
     </ClInclude>



More information about the Python-checkins mailing list