Merge branch 'master' into sh_merge_master

This commit is contained in:
Ralf W. Grosse-Kunstleve 2025-02-12 19:47:31 -08:00
commit 7d37eb9949
No known key found for this signature in database
3 changed files with 9 additions and 12 deletions

View File

@ -605,7 +605,7 @@ struct instance {
bool simple_instance_registered : 1;
/// If true, get_internals().patients has an entry for this object
bool has_patients : 1;
// Cannot use PYBIND11_INTERNALS_VERSION >= 6 here without refactoring.
// Cannot use PYBIND11_INTERNALS_VERSION >= 106 here without refactoring.
#if PYBIND11_VERSION_MAJOR >= 3
/// If true, this Python object needs to be kept alive for the lifetime of the C++ value.
bool is_alias : 1;

View File

@ -38,23 +38,17 @@
/// changed to the new version.
#ifndef PYBIND11_INTERNALS_VERSION
# if PYBIND11_VERSION_MAJOR >= 3
# define PYBIND11_INTERNALS_VERSION 6
# elif PY_VERSION_HEX >= 0x030C0000 || defined(_MSC_VER)
// Version bump for Python 3.12+, before first 3.12 beta release.
// Version bump for MSVC piggy-backed on PR #4779. See comments there.
# ifdef Py_GIL_DISABLED
# define PYBIND11_INTERNALS_VERSION 6
# else
# define PYBIND11_INTERNALS_VERSION 5
# endif
# define PYBIND11_INTERNALS_VERSION 106
# else
# define PYBIND11_INTERNALS_VERSION 4
# define PYBIND11_INTERNALS_VERSION 6
# endif
#endif
// This requirement is mainly to reduce the support burden (see PR #4570).
static_assert(PY_VERSION_HEX < 0x030C0000 || PYBIND11_INTERNALS_VERSION >= 5,
"pybind11 ABI version 5 is the minimum for Python 3.12+");
static_assert(PYBIND11_INTERNALS_VERSION >= 4,
"pybind11 ABI version 4 is the minimum for all platforms.");
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
@ -244,7 +238,7 @@ struct internals {
}
};
#if PYBIND11_INTERNALS_VERSION >= 6
#if PYBIND11_INTERNALS_VERSION >= 106
# define PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT

View File

@ -316,8 +316,11 @@ struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {
return false;
}
PYBIND11_WARNING_PUSH
PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") // See PR #5516
// Allocate the new type, then build a numpy reference into it
value = Type(fits.rows, fits.cols);
PYBIND11_WARNING_POP
auto ref = reinterpret_steal<array>(eigen_ref_array<props>(value));
if (dims == 1) {
ref = ref.squeeze();