Skip to content

Commit 717443d

Browse files
committed
[GR-51961] Keep our C file structure closer to CPython, part 2
PullRequest: graalpython/3197
2 parents 8d92a93 + 8226655 commit 717443d

File tree

17 files changed

+2966
-519
lines changed

17 files changed

+2966
-519
lines changed

graalpython/com.oracle.graal.python.cext/include/abstract.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -729,11 +729,13 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
729729
#define PySequence_Fast_GET_ITEM(o, i)\
730730
(PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
731731

732-
PyAPI_FUNC(PyObject **) _PySequence_Fast_ITEMS(PyObject *o);
732+
// GraalPy-specific
733+
PyAPI_FUNC(PyObject **) PyTruffleSequence_Fast_ITEMS(PyObject *o);
733734

734735
/* Return a pointer to the underlying item array for
735736
an object returned by PySequence_Fast */
736-
#define PySequence_Fast_ITEMS(sf) _PySequence_Fast_ITEMS(sf)
737+
// GraalPy change
738+
#define PySequence_Fast_ITEMS(sf) PyTruffleSequence_Fast_ITEMS(sf)
737739

738740
/* Return the number of occurrences on value on 'o', that is, return
739741
the number of keys for which o[key] == value.

graalpython/com.oracle.graal.python.cext/include/cpython/abstract.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
* Copyright (C) 1996-2020 Python Software Foundation
33
*
44
* Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
@@ -178,11 +178,13 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
178178

179179
/* === Sequence protocol ================================================ */
180180

181-
PyAPI_FUNC(PyObject*) _PySequence_ITEM(PyObject* obj, Py_ssize_t index);
181+
// GraalPy-specific
182+
PyAPI_FUNC(PyObject*) PyTruffleSequence_ITEM(PyObject* obj, Py_ssize_t index);
182183

183184
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
184185
need to be corrected for a negative index. */
185-
#define PySequence_ITEM(o, i) _PySequence_ITEM((o), (i))
186+
// GraalPy change
187+
#define PySequence_ITEM(o, i) PyTruffleSequence_ITEM((o), (i))
186188

187189
#define PY_ITERSEARCH_COUNT 1
188190
#define PY_ITERSEARCH_INDEX 2

0 commit comments

Comments
 (0)