From b8cf283e2eb07df6cfdbb7a2c396d1168f9c88ef Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 16 Feb 2025 13:48:32 +0100 Subject: [PATCH 1/3] Assert PYBIND11_INTERNALS_VERSION >= 6 ... when including smart_holder.h --- include/pybind11/smart_holder.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pybind11/smart_holder.h b/include/pybind11/smart_holder.h index 5f568a552..98db4f17d 100644 --- a/include/pybind11/smart_holder.h +++ b/include/pybind11/smart_holder.h @@ -5,6 +5,8 @@ #pragma once #include "pybind11.h" +static_assert(PYBIND11_INTERNALS_VERSION >= 6, + "pybind11 ABI version 6 is required for smart_holder functionality."); // Legacy macros introduced with smart_holder_type_casters implementation in 2021. // Deprecated. From 0a130f24f694e134a82a08494d09d6bd13a853c1 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 17 Feb 2025 05:01:18 +0100 Subject: [PATCH 2/3] Assert ABI version 106 --- include/pybind11/smart_holder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/smart_holder.h b/include/pybind11/smart_holder.h index 98db4f17d..ec905a744 100644 --- a/include/pybind11/smart_holder.h +++ b/include/pybind11/smart_holder.h @@ -5,8 +5,8 @@ #pragma once #include "pybind11.h" -static_assert(PYBIND11_INTERNALS_VERSION >= 6, - "pybind11 ABI version 6 is required for smart_holder functionality."); +static_assert(PYBIND11_INTERNALS_VERSION == 106, + "pybind11 ABI version 106 is required for smart_holder functionality."); // Legacy macros introduced with smart_holder_type_casters implementation in 2021. // Deprecated. From 972a2ec1f921909362469f2bbd91d6d0cdd3fe85 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Mon, 17 Feb 2025 08:55:44 +0100 Subject: [PATCH 3/3] Consider PYBIND11_SMART_HOLDER_DISABLE --- include/pybind11/smart_holder.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/pybind11/smart_holder.h b/include/pybind11/smart_holder.h index ec905a744..9c7a0d7c2 100644 --- a/include/pybind11/smart_holder.h +++ b/include/pybind11/smart_holder.h @@ -5,8 +5,11 @@ #pragma once #include "pybind11.h" -static_assert(PYBIND11_INTERNALS_VERSION == 106, + +#if !defined(PYBIND11_SMART_HOLDER_DISABLE) +static_assert(PYBIND11_INTERNALS_VERSION >= 106, "pybind11 ABI version 106 is required for smart_holder functionality."); +#endif // Legacy macros introduced with smart_holder_type_casters implementation in 2021. // Deprecated.