]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)
authorVictor Stinner <vstinner@redhat.com>
Sun, 25 Nov 2018 22:56:17 +0000 (23:56 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Nov 2018 22:56:17 +0000 (23:56 +0100)
Move _PyTuple_ITEMS() to a new header file:
Include/internal/pycore_tupleobject.h

12 files changed:
Include/internal/pycore_tupleobject.h [new file with mode: 0644]
Include/tupleobject.h
Makefile.pre.in
Modules/_functoolsmodule.c
Objects/call.c
Objects/codeobject.c
Objects/descrobject.c
Objects/funcobject.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/ceval.c
Python/getargs.c

diff --git a/Include/internal/pycore_tupleobject.h b/Include/internal/pycore_tupleobject.h
new file mode 100644 (file)
index 0000000..fdd7414
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef Py_INTERNAL_TUPLEOBJECT_H
+#define Py_INTERNAL_TUPLEOBJECT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
+#  error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
+#endif
+
+#include "tupleobject.h"
+
+#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item)
+
+#ifdef __cplusplus
+}
+#endif
+#endif   /* !Py_INTERNAL_TUPLEOBJECT_H */
index a150d07d3e0a4f07c979582c7943c41819400f06..eec2d98f2d95754d05176939fcc3ad62c7043c34 100644 (file)
@@ -61,10 +61,6 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
 #define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i])
 #define PyTuple_GET_SIZE(op)    (assert(PyTuple_Check(op)), Py_SIZE(op))
 
-#ifdef Py_BUILD_CORE
-#  define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item)
-#endif
-
 /* Macro, *only* to be used to fill in brand new tuples */
 #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v)
 #endif
index d0e915a00ae08ec1e6104b346bd94585193b2eee..2c92db23489ec35a9c797c380b3702c5d2db5b3c 100644 (file)
@@ -1043,6 +1043,7 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/internal/pycore_pylifecycle.h \
                $(srcdir)/Include/internal/pycore_pymem.h \
                $(srcdir)/Include/internal/pycore_pystate.h \
+               $(srcdir)/Include/internal/pycore_tupleobject.h \
                $(srcdir)/Include/internal/pycore_warnings.h \
                $(DTRACE_HEADERS)
 
index 773102bb5900faeccd8f71174accec1a0fdbaa04..8701f6c89d71d657bf518e7cde4019d68835c0bb 100644 (file)
@@ -1,7 +1,7 @@
-
 #include "Python.h"
 #include "pycore_pymem.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 #include "structmember.h"
 
 /* _functools module written and maintained
index ce346c2934869d4e82fb8d1b54f378de25fc737d..ba2ddcb35b9b29d05851e165fb4bd9252e933abb 100644 (file)
@@ -1,6 +1,7 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 #include "frameobject.h"
 
 
index a2efa7ed03f5bb255124e4bae525dc74182ae52f..09182d61c24474f32ada82844ed80e871f903154 100644 (file)
@@ -4,6 +4,7 @@
 #include "code.h"
 #include "structmember.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 
 /* Holder for co_extra information */
 typedef struct {
index dd3c5014aea79845a997c02b1ae66f4153c545de..23d4b1a29e6f6471ba4275b7f55eb31bf934e35a 100644 (file)
@@ -3,6 +3,7 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 #include "structmember.h" /* Why is this not included in Python.h? */
 
 /*[clinic input]
index 982df5434d25433afb32dfb29403f0684821a3c5..c77e4e9f4e89a1e31f14de68100f55877eca23c4 100644 (file)
@@ -5,6 +5,7 @@
 #include "pycore_object.h"
 #include "pycore_pymem.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 #include "code.h"
 #include "structmember.h"
 
index 34cd3796888cfc1deff4c380697100ade5ea693c..8aa4c0610f60b3ad63449a61afe416edac1c8fe7 100644 (file)
     <ClInclude Include="..\Include\internal\pycore_pylifecycle.h" />
     <ClInclude Include="..\Include\internal\pycore_pymem.h" />
     <ClInclude Include="..\Include\internal\pycore_pystate.h" />
+    <ClInclude Include="..\Include\internal\pycore_tupleobject.h" />
     <ClInclude Include="..\Include\internal\pycore_warnings.h" />
     <ClInclude Include="..\Include\intrcheck.h" />
     <ClInclude Include="..\Include\iterobject.h" />
index ebe5e8a169fdc9673992ce1e327791965a39ed93..021a67efccbc83a0b7f6e8593fd0710c0c4a7bb0 100644 (file)
     <ClInclude Include="..\Include\internal\pycore_pystate.h">
       <Filter>Include</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\internal\pycore_tupleobject.h">
+      <Filter>Include</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\internal\pycore_warnings.h">
       <Filter>Include</Filter>
     </ClInclude>
index 7b2465592a4b998ac4ce5d88ffe8201b68afdbd8..a4273adee48d812f118afe6a3e99db8305c4502c 100644 (file)
@@ -12,6 +12,7 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pystate.h"
+#include "pycore_tupleobject.h"
 
 #include "code.h"
 #include "dictobject.h"
index 89df29e31527a5833b93d0d99cdd94fe9f232de0..ac8bac3bf50bc2296c1506527579d70bac4a1167 100644 (file)
@@ -2,6 +2,7 @@
 /* New getargs implementation */
 
 #include "Python.h"
+#include "pycore_tupleobject.h"
 
 #include <ctype.h>
 #include <float.h>