Skip to content

Commit 33b8a8d

Browse files
committed
Add PyAPI_FUNC()
1 parent bec2a0f commit 33b8a8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Include/object.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y);
239239
#define Py_Is(x, y) ((x) == (y))
240240

241241
#if defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
242-
inline uintptr_t
242+
inline PyAPI_FUNC(uintptr_t)
243243
_Py_ThreadId(void)
244244
{
245245
uintptr_t tid;
@@ -285,7 +285,7 @@ _Py_ThreadId(void)
285285
return tid;
286286
}
287287

288-
inline Py_ALWAYS_INLINE int
288+
inline Py_ALWAYS_INLINE PyAPI_FUNC(int)
289289
_Py_IsOwnedByCurrentThread(PyObject *ob)
290290
{
291291
return ob->ob_tid == _Py_ThreadId();
@@ -333,7 +333,7 @@ static inline Py_ssize_t Py_SIZE(PyObject *ob) {
333333
#endif
334334

335335
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030d0000
336-
inline Py_ALWAYS_INLINE int _Py_IsImmortal(PyObject *op)
336+
inline Py_ALWAYS_INLINE PyAPI_FUNC(int) _Py_IsImmortal(PyObject *op)
337337
{
338338
#if defined(Py_GIL_DISABLED)
339339
return (op->ob_ref_local == _Py_IMMORTAL_REFCNT_LOCAL);
@@ -360,7 +360,7 @@ static inline int Py_IS_TYPE(PyObject *ob, PyTypeObject *type) {
360360
#if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030d0000
361361
PyAPI_DATA(void) Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt);
362362
#else
363-
inline void Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) {
363+
inline PyAPI_FUNC(void) Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) {
364364
// This immortal check is for code that is unaware of immortal objects.
365365
// The runtime tracks these objects and we should avoid as much
366366
// as possible having extensions inadvertently change the refcnt

0 commit comments

Comments
 (0)