Skip to content

Commit

Permalink
patch 8.2.2995: linker errors with dynamic Python 3.10
Browse files Browse the repository at this point in the history
Problem:    Linker errors with dynamic Python 3.10.
Solution:   Add a couple of library entries. (Zdenek Dohnal, closes #8381,
            closes #8356)
  • Loading branch information
zdohnal authored and brammool committed Jun 14, 2021
1 parent 2d6d718 commit 90478f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/if_python3.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ typedef PySliceObject PySliceObject_T;
# ifndef PyMapping_Keys
# define PyMapping_Keys py3_PyMapping_Keys
# endif
# if PY_VERSION_HEX >= 0x030a00b2
# define PyIter_Check py3_PyIter_Check
# endif
# define PyIter_Next py3_PyIter_Next
# define PyObject_GetIter py3_PyObject_GetIter
# define PyObject_Repr py3_PyObject_Repr
Expand Down Expand Up @@ -358,6 +361,9 @@ static PyObject* (*py3_PyDict_GetItemString)(PyObject *, const char *);
static int (*py3_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **);
static PyObject* (*py3_PyLong_FromLong)(long);
static PyObject* (*py3_PyDict_New)(void);
# if PY_VERSION_HEX >= 0x030a00b2
static int (*py3_PyIter_Check)(PyObject *o);
# endif
static PyObject* (*py3_PyIter_Next)(PyObject *);
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
static PyObject* (*py3_PyObject_Repr)(PyObject *);
Expand Down Expand Up @@ -538,6 +544,9 @@ static struct
{"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next},
{"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check},
{"PyMapping_Keys", (PYTHON_PROC*)&py3_PyMapping_Keys},
# if PY_VERSION_HEX >= 0x030a00b2
{"PyIter_Check", (PYTHON_PROC*)&py3_PyIter_Check},
# endif
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
{"PyObject_Repr", (PYTHON_PROC*)&py3_PyObject_Repr},
Expand Down Expand Up @@ -671,6 +680,15 @@ py3_PyType_HasFeature(PyTypeObject *type, unsigned long feature)
# define PyType_HasFeature(t,f) py3_PyType_HasFeature(t,f)
# endif

# if PY_VERSION_HEX >= 0x030a00b2
static inline int
py3__PyObject_TypeCheck(PyObject *ob, PyTypeObject *type)
{
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
}
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
# endif

# ifdef MSWIN
/*
* Look up the library "libname" using the InstallPath registry key.
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2995,
/**/
2994,
/**/
Expand Down

0 comments on commit 90478f3

Please sign in to comment.