summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-25 22:56:17 (GMT)
committerGitHub <noreply@github.com>2018-11-25 22:56:17 (GMT)
commitec13b9322d95a651606219469fc7b7e9c977f248 (patch)
tree3fe923cfef5fafe9b5cba193b9dc54b8fd3c7bc2 /Include
parent8ac6539d85b481fc6b5e9145446b07e591b2caba (diff)
downloadcpython-ec13b9322d95a651606219469fc7b7e9c977f248.zip
cpython-ec13b9322d95a651606219469fc7b7e9c977f248.tar.gz
cpython-ec13b9322d95a651606219469fc7b7e9c977f248.tar.bz2
bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)
Move _PyTuple_ITEMS() to a new header file: Include/internal/pycore_tupleobject.h
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_tupleobject.h18
-rw-r--r--Include/tupleobject.h4
2 files changed, 18 insertions, 4 deletions
diff --git a/Include/internal/pycore_tupleobject.h b/Include/internal/pycore_tupleobject.h
new file mode 100644
index 0000000..fdd7414
--- /dev/null
+++ b/Include/internal/pycore_tupleobject.h
@@ -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 */
diff --git a/Include/tupleobject.h b/Include/tupleobject.h
index a150d07..eec2d98 100644
--- a/Include/tupleobject.h
+++ b/Include/tupleobject.h
@@ -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