mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-135906: Use _PyObject_CAST in internal headers (GH-135892) (GH-136392)
gh-135906: Use `_PyObject_CAST` in internal headers (GH-135892)
Fixes build errors encountered in python-greenlet/greenlet#450 when building greenlet on the free-threaded build.
---------
(cherry picked from commit fe187fae8d)
Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
5a7d266fcb
commit
c72699086f
3 changed files with 4 additions and 3 deletions
|
|
@ -614,7 +614,7 @@ static inline PyObject *
|
||||||
_Py_XGetRef(PyObject **ptr)
|
_Py_XGetRef(PyObject **ptr)
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
PyObject *value = _Py_atomic_load_ptr(ptr);
|
PyObject *value = _PyObject_CAST(_Py_atomic_load_ptr(ptr));
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
@ -629,7 +629,7 @@ _Py_XGetRef(PyObject **ptr)
|
||||||
static inline PyObject *
|
static inline PyObject *
|
||||||
_Py_TryXGetRef(PyObject **ptr)
|
_Py_TryXGetRef(PyObject **ptr)
|
||||||
{
|
{
|
||||||
PyObject *value = _Py_atomic_load_ptr(ptr);
|
PyObject *value = _PyObject_CAST(_Py_atomic_load_ptr(ptr));
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -765,7 +765,7 @@ _Py_TryIncrefCompareStackRef(PyObject **src, PyObject *op, _PyStackRef *out)
|
||||||
static inline int
|
static inline int
|
||||||
_Py_TryXGetStackRef(PyObject **src, _PyStackRef *out)
|
_Py_TryXGetStackRef(PyObject **src, _PyStackRef *out)
|
||||||
{
|
{
|
||||||
PyObject *op = _Py_atomic_load_ptr_relaxed(src);
|
PyObject *op = _PyObject_CAST(_Py_atomic_load_ptr_relaxed(src));
|
||||||
if (op == NULL) {
|
if (op == NULL) {
|
||||||
*out = PyStackRef_NULL;
|
*out = PyStackRef_NULL;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Fix compilation errors when compiling the internal headers with a C++ compiler.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue