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
This commit is contained in:
Ralf W. Grosse-Kunstleve
2026-03-30 12:33:20 -07:00
parent 76efcb3715
commit c066c762ba

View File

@@ -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