Skip to content

Commit 90478f3

Browse files
zdohnalbrammool
authored andcommitted
patch 8.2.2995: linker errors with dynamic Python 3.10
Problem: Linker errors with dynamic Python 3.10. Solution: Add a couple of library entries. (Zdenek Dohnal, closes #8381, closes #8356)
1 parent 2d6d718 commit 90478f3

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/if_python3.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ typedef PySliceObject PySliceObject_T;
184184
# ifndef PyMapping_Keys
185185
# define PyMapping_Keys py3_PyMapping_Keys
186186
# endif
187+
# if PY_VERSION_HEX >= 0x030a00b2
188+
# define PyIter_Check py3_PyIter_Check
189+
# endif
187190
# define PyIter_Next py3_PyIter_Next
188191
# define PyObject_GetIter py3_PyObject_GetIter
189192
# define PyObject_Repr py3_PyObject_Repr
@@ -358,6 +361,9 @@ static PyObject* (*py3_PyDict_GetItemString)(PyObject *, const char *);
358361
static int (*py3_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **);
359362
static PyObject* (*py3_PyLong_FromLong)(long);
360363
static PyObject* (*py3_PyDict_New)(void);
364+
# if PY_VERSION_HEX >= 0x030a00b2
365+
static int (*py3_PyIter_Check)(PyObject *o);
366+
# endif
361367
static PyObject* (*py3_PyIter_Next)(PyObject *);
362368
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
363369
static PyObject* (*py3_PyObject_Repr)(PyObject *);
@@ -538,6 +544,9 @@ static struct
538544
{"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next},
539545
{"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check},
540546
{"PyMapping_Keys", (PYTHON_PROC*)&py3_PyMapping_Keys},
547+
# if PY_VERSION_HEX >= 0x030a00b2
548+
{"PyIter_Check", (PYTHON_PROC*)&py3_PyIter_Check},
549+
# endif
541550
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
542551
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
543552
{"PyObject_Repr", (PYTHON_PROC*)&py3_PyObject_Repr},
@@ -671,6 +680,15 @@ py3_PyType_HasFeature(PyTypeObject *type, unsigned long feature)
671680
# define PyType_HasFeature(t,f) py3_PyType_HasFeature(t,f)
672681
# endif
673682

683+
# if PY_VERSION_HEX >= 0x030a00b2
684+
static inline int
685+
py3__PyObject_TypeCheck(PyObject *ob, PyTypeObject *type)
686+
{
687+
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
688+
}
689+
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
690+
# endif
691+
674692
# ifdef MSWIN
675693
/*
676694
* Look up the library "libname" using the InstallPath registry key.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2995,
753755
/**/
754756
2994,
755757
/**/

0 commit comments

Comments
 (0)