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