diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-09-17 22:03:44 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-09-17 22:03:44 +0300 |
commit | 49726f2627f20969d8e6358fc107bdf139c87f99 (patch) | |
tree | f94d610e293cb577fbf973b1d0ac07c005c948d0 /contrib/restricted/boost/python/src/object/class.cpp | |
parent | e4065899cddff8a7bde3bc774f33e9b6bebd961c (diff) | |
download | ydb-49726f2627f20969d8e6358fc107bdf139c87f99.tar.gz |
Update contrib/restricted/boost/interprocess to 1.80.0
Diffstat (limited to 'contrib/restricted/boost/python/src/object/class.cpp')
-rw-r--r-- | contrib/restricted/boost/python/src/object/class.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/contrib/restricted/boost/python/src/object/class.cpp b/contrib/restricted/boost/python/src/object/class.cpp index 8d0daf63d7..9f8dc61ad1 100644 --- a/contrib/restricted/boost/python/src/object/class.cpp +++ b/contrib/restricted/boost/python/src/object/class.cpp @@ -208,7 +208,7 @@ namespace objects { if (static_data_object.tp_dict == 0) { - Py_TYPE(&static_data_object) = &PyType_Type; + Py_SET_TYPE(&static_data_object, &PyType_Type); static_data_object.tp_base = &PyProperty_Type; if (PyType_Ready(&static_data_object)) return 0; @@ -316,7 +316,7 @@ namespace objects { if (class_metatype_object.tp_dict == 0) { - Py_TYPE(&class_metatype_object) = &PyType_Type; + Py_SET_TYPE(&class_metatype_object, &PyType_Type); class_metatype_object.tp_base = &PyType_Type; if (PyType_Ready(&class_metatype_object)) return type_handle(); @@ -374,12 +374,7 @@ namespace objects // like, so we'll store the total size of the object // there. A negative number indicates that the extra // instance memory is not yet allocated to any holders. -#if PY_VERSION_HEX >= 0x02060000 - Py_SIZE(result) = -#else - result->ob_size = -#endif - -(static_cast<int>(offsetof(instance<>,storage) + instance_size)); + Py_SET_SIZE(result,-static_cast<int>(offsetof(instance<>,storage) + instance_size)); } return (PyObject*)result; } @@ -470,7 +465,7 @@ namespace objects { if (class_type_object.tp_dict == 0) { - Py_TYPE(&class_type_object) = incref(class_metatype().get()); + Py_SET_TYPE(&class_type_object, incref(class_metatype().get())); class_type_object.tp_base = &PyBaseObject_Type; if (PyType_Ready(&class_type_object)) return type_handle(); @@ -618,7 +613,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("Osss"), fget.ptr(), 0, 0, docstr)); + PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("Osss"), fget.ptr(), (char*)NULL, (char*)NULL, docstr)); this->setattr(name, property); } @@ -628,7 +623,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), 0, docstr)); + PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), (char*)NULL, docstr)); this->setattr(name, property); } @@ -739,7 +734,7 @@ void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset, std: assert(holder_offset >= offsetof(objects::instance<>,storage)); // Record the fact that the storage is occupied, noting where it starts - Py_SIZE(self) = holder_offset; + Py_SET_SIZE(self, holder_offset); return (char*)self + holder_offset; } else |