diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index 4163673df..095475974 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -219,7 +219,11 @@ public: // (get_value_and_holder, allocate_layout, and deallocate_layout are declared inside // struct instance in detail/common.h; definitions are in type_caster_base-inl.h.) +PYBIND11_WARNING_PUSH +PYBIND11_WARNING_DISABLE_GCC("-Wredundant-decls") +// also forward-declared in pytypes.h bool isinstance_generic(handle obj, const std::type_info &tp); +PYBIND11_WARNING_POP handle get_object_handle(const void *ptr, const detail::type_info *type); diff --git a/include/pybind11/gil.h b/include/pybind11/gil.h index 9e799b3cf..e43d4cb2e 100644 --- a/include/pybind11/gil.h +++ b/include/pybind11/gil.h @@ -9,9 +9,12 @@ #pragma once +// common.h must come first: on PyPy/GraalPy it defines PYBIND11_SIMPLE_GIL_MANAGEMENT, +// which selects the branch below. +#include "detail/common.h" + #if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT) -# include "detail/common.h" # include "gil_simple.h" PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) @@ -23,7 +26,6 @@ PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) #else -# include "detail/common.h" # include "detail/internals.h" # include