mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-23 08:59:43 +00:00
Merge branch 'master' into sh_merge_master
This commit is contained in:
commit
7d37eb9949
@ -605,7 +605,7 @@ struct instance {
|
|||||||
bool simple_instance_registered : 1;
|
bool simple_instance_registered : 1;
|
||||||
/// If true, get_internals().patients has an entry for this object
|
/// If true, get_internals().patients has an entry for this object
|
||||||
bool has_patients : 1;
|
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 PYBIND11_VERSION_MAJOR >= 3
|
||||||
/// If true, this Python object needs to be kept alive for the lifetime of the C++ value.
|
/// If true, this Python object needs to be kept alive for the lifetime of the C++ value.
|
||||||
bool is_alias : 1;
|
bool is_alias : 1;
|
||||||
|
@ -38,23 +38,17 @@
|
|||||||
/// changed to the new version.
|
/// changed to the new version.
|
||||||
#ifndef PYBIND11_INTERNALS_VERSION
|
#ifndef PYBIND11_INTERNALS_VERSION
|
||||||
# if PYBIND11_VERSION_MAJOR >= 3
|
# if PYBIND11_VERSION_MAJOR >= 3
|
||||||
# define PYBIND11_INTERNALS_VERSION 6
|
# define PYBIND11_INTERNALS_VERSION 106
|
||||||
# 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
|
# else
|
||||||
# define PYBIND11_INTERNALS_VERSION 5
|
# define PYBIND11_INTERNALS_VERSION 6
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define PYBIND11_INTERNALS_VERSION 4
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This requirement is mainly to reduce the support burden (see PR #4570).
|
// This requirement is mainly to reduce the support burden (see PR #4570).
|
||||||
static_assert(PY_VERSION_HEX < 0x030C0000 || PYBIND11_INTERNALS_VERSION >= 5,
|
static_assert(PY_VERSION_HEX < 0x030C0000 || PYBIND11_INTERNALS_VERSION >= 5,
|
||||||
"pybind11 ABI version 5 is the minimum for Python 3.12+");
|
"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)
|
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
|
# define PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT
|
||||||
|
|
||||||
|
@ -316,8 +316,11 @@ struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::value>> {
|
|||||||
return false;
|
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
|
// Allocate the new type, then build a numpy reference into it
|
||||||
value = Type(fits.rows, fits.cols);
|
value = Type(fits.rows, fits.cols);
|
||||||
|
PYBIND11_WARNING_POP
|
||||||
auto ref = reinterpret_steal<array>(eigen_ref_array<props>(value));
|
auto ref = reinterpret_steal<array>(eigen_ref_array<props>(value));
|
||||||
if (dims == 1) {
|
if (dims == 1) {
|
||||||
ref = ref.squeeze();
|
ref = ref.squeeze();
|
||||||
|
Loading…
Reference in New Issue
Block a user