Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPPDataMember.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,7 @@ PyTypeObject CPPDataMember_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
Expand Down
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPPExcInstance.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,7 @@ PyTypeObject CPPExcInstance_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1125,12 +1125,7 @@ PyTypeObject CPPInstance_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1092,12 +1092,7 @@ PyTypeObject CPPOverload_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
Expand Down
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPPScope.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,7 @@ PyTypeObject CPPScope_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
30 changes: 30 additions & 0 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPyCppyy.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,34 @@ static inline PyObject* PyObject_CallMethodOneArg(PyObject* obj, PyObject* name,
// export macros for our own API
#include "CPyCppyy/CommonDefs.h"

// --- reusable PyTypeObject initializer tail -------------------------------
// Members appended to PyTypeObject in newer CPython releases. Every CPyCppyy
// type leaves all of these zero/null-initialized, so they share one tail.
// To support a future Python version, add one block below and one line to
// CPYCPPYY_PYTYPE_TAIL.

#if PY_VERSION_HEX >= 0x030c0000
#define CPYCPPYY_TP_WATCHED , 0 /* tp_watched (>= 3.12) */
#else
#define CPYCPPYY_TP_WATCHED
#endif

#if PY_VERSION_HEX >= 0x030d0000
#define CPYCPPYY_TP_VERSIONS_USED , 0 /* tp_versions_used(>= 3.13) */
#else
#define CPYCPPYY_TP_VERSIONS_USED
#endif

#if PY_VERSION_HEX >= 0x030f0000
#define CPYCPPYY_TP_ITERITEM , nullptr /* _tp_iteritem (>= 3.15) */
#else
#define CPYCPPYY_TP_ITERITEM
#endif

#define CPYCPPYY_PYTYPE_TAIL \
CPYCPPYY_TP_WATCHED \
CPYCPPYY_TP_VERSIONS_USED \
CPYCPPYY_TP_ITERITEM
// --------------------------------------------------------------------------

#endif // !CPYCPPYY_CPYCPPYY_H
14 changes: 2 additions & 12 deletions bindings/pyroot/cppyy/CPyCppyy/src/CPyCppyyModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ static PyTypeObject PyNullPtr_t_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};


Expand Down Expand Up @@ -218,12 +213,7 @@ static PyTypeObject PyDefault_t_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

namespace {
Expand Down
28 changes: 4 additions & 24 deletions bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,7 @@ PyTypeObject TypedefPointerToClass_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

//= instancemethod object with a more efficient call function ================
Expand Down Expand Up @@ -341,12 +336,7 @@ PyTypeObject CustomInstanceMethod_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};


Expand Down Expand Up @@ -401,12 +391,7 @@ PyTypeObject IndexIter_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};


Expand Down Expand Up @@ -472,12 +457,7 @@ PyTypeObject VectorIter_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/LowLevelViews.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -980,12 +980,7 @@ PyTypeObject LowLevelView_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
Expand Down
7 changes: 1 addition & 6 deletions bindings/pyroot/cppyy/CPyCppyy/src/TemplateProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -978,12 +978,7 @@ PyTypeObject TemplateProxy_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
14 changes: 2 additions & 12 deletions bindings/pyroot/cppyy/CPyCppyy/src/TupleOfInstances.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,7 @@ PyTypeObject InstanceArrayIter_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};


Expand Down Expand Up @@ -254,12 +249,7 @@ PyTypeObject TupleOfInstances_Type = {
#if PY_VERSION_HEX >= 0x03080000
, 0 // tp_vectorcall
#endif
#if PY_VERSION_HEX >= 0x030c0000
, 0 // tp_watched
#endif
#if PY_VERSION_HEX >= 0x030d0000
, 0 // tp_versions_used
#endif
CPYCPPYY_PYTYPE_TAIL
};

} // namespace CPyCppyy
Loading