From e4456197c4d95a6db933bb4ecdd58e76c5763502 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 19 Jul 2024 10:18:05 -0700 Subject: [PATCH] Ignore PYBIND11_USE_SMART_HOLDER_AS_DEFAULT if PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT is not defined. --- include/pybind11/pybind11.h | 3 ++- tests/test_class.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index ffce923ed..6fb8ca6f8 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1797,7 +1797,8 @@ struct property_cpp_function< #endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT -#ifdef PYBIND11_USE_SMART_HOLDER_AS_DEFAULT +#if defined(PYBIND11_USE_SMART_HOLDER_AS_DEFAULT) \ + && defined(PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT) // BAKEIN_WIP: Add comment to explain: This is meant for stress-testing only. template using default_holder_type = smart_holder; diff --git a/tests/test_class.cpp b/tests/test_class.cpp index a94b8e584..494a38b81 100644 --- a/tests/test_class.cpp +++ b/tests/test_class.cpp @@ -613,7 +613,8 @@ CHECK_NOALIAS(8); CHECK_HOLDER(1, unique); CHECK_HOLDER(2, unique); CHECK_HOLDER(3, unique); -#ifdef PYBIND11_USE_SMART_HOLDER_AS_DEFAULT +#if defined(PYBIND11_USE_SMART_HOLDER_AS_DEFAULT) \ + && defined(PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT) CHECK_SMART_HOLDER(4); CHECK_SMART_HOLDER(5); #else