Skip to content

Commit

Permalink
Add PyAPI_FUNC()
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Dec 7, 2023
1 parent bec2a0f commit 33b8a8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y);
#define Py_Is(x, y) ((x) == (y))

#if defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)
inline uintptr_t
inline PyAPI_FUNC(uintptr_t)
_Py_ThreadId(void)
{
uintptr_t tid;
Expand Down Expand Up @@ -285,7 +285,7 @@ _Py_ThreadId(void)
return tid;
}

inline Py_ALWAYS_INLINE int
inline Py_ALWAYS_INLINE PyAPI_FUNC(int)
_Py_IsOwnedByCurrentThread(PyObject *ob)
{
return ob->ob_tid == _Py_ThreadId();
Expand Down Expand Up @@ -333,7 +333,7 @@ static inline Py_ssize_t Py_SIZE(PyObject *ob) {
#endif

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

0 comments on commit 33b8a8d

Please sign in to comment.