@@ -1569,6 +1569,11 @@ static inline int PyLong_IsZero(PyObject *obj)
15691569
15701570// gh-124502 added PyUnicode_Equal() to Python 3.14.0a0
15711571#if PY_VERSION_HEX < 0x030E00A0
1572+
1573+ #if PY_VERSION_HEX >= 0x030d0000 && !defined(PYPY_VERSION)
1574+ PyAPI_FUNC (int ) _PyUnicode_Equal (PyObject *str1, PyObject *str2);
1575+ #endif
1576+
15721577static inline int PyUnicode_Equal (PyObject *str1, PyObject *str2)
15731578{
15741579 if (!PyUnicode_Check (str1)) {
@@ -1583,8 +1588,6 @@ static inline int PyUnicode_Equal(PyObject *str1, PyObject *str2)
15831588 }
15841589
15851590#if PY_VERSION_HEX >= 0x030d0000 && !defined(PYPY_VERSION)
1586- PyAPI_FUNC (int ) _PyUnicode_Equal (PyObject *str1, PyObject *str2);
1587-
15881591 return _PyUnicode_Equal (str1, str2);
15891592#elif PY_VERSION_HEX >= 0x03060000 && !defined(PYPY_VERSION)
15901593 return _PyUnicode_EQ (str1, str2);
@@ -1607,11 +1610,14 @@ static inline PyObject* PyBytes_Join(PyObject *sep, PyObject *iterable)
16071610
16081611
16091612#if PY_VERSION_HEX < 0x030E00A0
1613+
1614+ #if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION)
1615+ PyAPI_FUNC (Py_hash_t) _Py_HashBytes (const void *src, Py_ssize_t len);
1616+ #endif
1617+
16101618static inline Py_hash_t Py_HashBuffer (const void *ptr, Py_ssize_t len)
16111619{
16121620#if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION)
1613- PyAPI_FUNC (Py_hash_t) _Py_HashBytes (const void *src, Py_ssize_t len);
1614-
16151621 return _Py_HashBytes (ptr, len);
16161622#else
16171623 Py_hash_t hash;
@@ -1948,11 +1954,14 @@ PyLongWriter_Finish(PyLongWriter *writer)
19481954
19491955// gh-127350 added Py_fopen() and Py_fclose() to Python 3.14a4
19501956#if PY_VERSION_HEX < 0x030E00A4
1957+
1958+ #if 0x030400A2 <= PY_VERSION_HEX && !defined(PYPY_VERSION)
1959+ PyAPI_FUNC (FILE*) _Py_fopen_obj (PyObject *path, const char *mode);
1960+ #endif
1961+
19511962static inline FILE* Py_fopen (PyObject *path, const char *mode)
19521963{
19531964#if 0x030400A2 <= PY_VERSION_HEX && !defined(PYPY_VERSION)
1954- PyAPI_FUNC (FILE*) _Py_fopen_obj (PyObject *path, const char *mode);
1955-
19561965 return _Py_fopen_obj (path, mode);
19571966#else
19581967 FILE *f;
@@ -2664,6 +2673,10 @@ PyUnstable_Unicode_GET_CACHED_HASH(PyObject *op)
26642673// to make objects immortal until 3.14 which has _Py_SetImmortal(). Since
26652674// immortal objects are primarily needed for free-threading, this API is implemented
26662675// for 3.14 using _Py_SetImmortal() and uses private macros on 3.13.
2676+ #if 0x030E0000 <= PY_VERSION_HEX
2677+ PyAPI_FUNC (void ) _Py_SetImmortal (PyObject *op);
2678+ #endif
2679+
26672680static inline int
26682681PyUnstable_SetImmortal (PyObject *op)
26692682{
@@ -2672,7 +2685,6 @@ PyUnstable_SetImmortal(PyObject *op)
26722685 return 0 ;
26732686 }
26742687#if 0x030E0000 <= PY_VERSION_HEX
2675- PyAPI_FUNC (void ) _Py_SetImmortal (PyObject *op);
26762688 _Py_SetImmortal (op);
26772689#else
26782690 // Python 3.13 doesn't export _Py_SetImmortal() function
0 commit comments