forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-111506: Rename _Py_SetRefcnt() to Py_SET_REFCNT()
- Loading branch information
Showing
11 changed files
with
85 additions
and
65 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Stable ABI implementation for PyObject functions. | ||
|
||
|
||
// Rename static inline functions with macros | ||
#define _Py_STABLE_ABI_IMPL | ||
|
||
#include "Python.h" | ||
|
||
|
||
#undef Py_NewRef | ||
#undef Py_XNewRef | ||
|
||
// Export Py_NewRef() and Py_XNewRef() as regular functions for the stable ABI. | ||
PyObject* | ||
Py_NewRef(PyObject *obj) | ||
{ | ||
return _Py_NewRef(obj); | ||
} | ||
|
||
PyObject* | ||
Py_XNewRef(PyObject *obj) | ||
{ | ||
return _Py_XNewRef(obj); | ||
} | ||
|
||
|
||
#undef Py_Is | ||
#undef Py_IsNone | ||
#undef Py_IsTrue | ||
#undef Py_IsFalse | ||
|
||
// Export Py_Is(), Py_IsNone(), Py_IsTrue(), Py_IsFalse() as regular functions | ||
// for the stable ABI. | ||
int Py_Is(PyObject *x, PyObject *y) | ||
{ | ||
return (x == y); | ||
} | ||
|
||
int Py_IsNone(PyObject *x) | ||
{ | ||
return Py_Is(x, Py_None); | ||
} | ||
|
||
int Py_IsTrue(PyObject *x) | ||
{ | ||
return Py_Is(x, Py_True); | ||
} | ||
|
||
int Py_IsFalse(PyObject *x) | ||
{ | ||
return Py_Is(x, Py_False); | ||
} | ||
|
||
|
||
#undef Py_SET_REFCNT | ||
|
||
void | ||
Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) | ||
{ | ||
_Py_SET_REFCNT(ob, refcnt); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters