mirror of
https://github.com/pybind/pybind11.git
synced 2026-07-17 00:57:36 +00:00
[smart_holder] Simplification: Enable smart_holder functionality unconditionally. (#5531)
* git merge --squash purge_internals_versions_4_5
* Remove PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT, set PYBIND11_INTERNALS_VERSION 7
* Remove all uses of PYBIND11_SMART_HOLDER_ENABLED under include/pybind11
* Remove obsolete PYBIND11_ACTUALLY_USING_SMART_HOLDER_AS_DEFAULT macro.
* Remove PYBIND11_SMART_HOLDER_ENABLED in ubench/holder_comparison.cpp
* Remove all uses of PYBIND11_SMART_HOLDER_ENABLED under tests/
* Remove `#define PYBIND11_SMART_HOLDER_ENABLED`
* Remove all uses of PYBIND11_SMART_HOLDER_TYPE_CASTERS under tests/
* Remove all uses of PYBIND11_TYPE_CASTER_BASE_HOLDER under tests/
* Add missing `#include <cstdint>`
Example error message (🐍 3.11 • ubuntu-latest • x64, GNU 13.3.0):
```
include/pybind11/detail/value_and_holder.h:56:52: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
56 | inst->nonsimple.status[index] &= (std::uint8_t) ~instance::status_holder_constructed;
| ^~~~~~~
```
* Change PYBIND11_INTERNALS_VERSION to 106: It will be changed to 7 in a follow-on PR that actually changes the internals.
This commit is contained in:
committed by
GitHub
parent
dc37cba85d
commit
5ab036bf08
@@ -57,18 +57,7 @@ struct SpGoAwayTester {
|
||||
|
||||
using namespace pybind11_tests::class_sh_trampoline_shared_ptr_cpp_arg;
|
||||
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpBase)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpBaseTester)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpGoAway)
|
||||
PYBIND11_SMART_HOLDER_TYPE_CASTERS(SpGoAwayTester)
|
||||
|
||||
TEST_SUBMODULE(class_sh_trampoline_shared_ptr_cpp_arg, m) {
|
||||
m.attr("defined_PYBIND11_SMART_HOLDER_ENABLED") =
|
||||
#ifndef PYBIND11_SMART_HOLDER_ENABLED
|
||||
false;
|
||||
#else
|
||||
true;
|
||||
|
||||
// For testing whether a python subclass of a C++ object dies when the
|
||||
// last python reference is lost
|
||||
|
||||
@@ -101,5 +90,4 @@ TEST_SUBMODULE(class_sh_trampoline_shared_ptr_cpp_arg, m) {
|
||||
py::classh<SpGoAwayTester>(m, "SpGoAwayTester")
|
||||
.def(py::init<>())
|
||||
.def_readwrite("obj", &SpGoAwayTester::m_obj);
|
||||
#endif // PYBIND11_SMART_HOLDER_ENABLED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user