fix: add missing PYBIND11_ALWAYS_INLINE macro for v3.0.3 backports Cherry-picking #5992 without #5887 left this macro undefined and broke builds, so this restores the expected inline helper definition with the smallest possible change. Made-with: Cursor
diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 2ca1558..7158923 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h
@@ -167,6 +167,14 @@ # define PYBIND11_NOINLINE __attribute__((noinline)) inline #endif +#if defined(_MSC_VER) +# define PYBIND11_ALWAYS_INLINE __forceinline +#elif defined(__GNUC__) +# define PYBIND11_ALWAYS_INLINE __attribute__((__always_inline__)) inline +#else +# define PYBIND11_ALWAYS_INLINE inline +#endif + #if defined(__MINGW32__) // For unknown reasons all PYBIND11_DEPRECATED member trigger a warning when declared // whether it is used or not