Skip to content

Commit c066c76

Browse files
committed
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
1 parent 76efcb3 commit c066c76

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/pybind11/detail/common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@
167167
# define PYBIND11_NOINLINE __attribute__((noinline)) inline
168168
#endif
169169

170+
#if defined(_MSC_VER)
171+
# define PYBIND11_ALWAYS_INLINE __forceinline
172+
#elif defined(__GNUC__)
173+
# define PYBIND11_ALWAYS_INLINE __attribute__((__always_inline__)) inline
174+
#else
175+
# define PYBIND11_ALWAYS_INLINE inline
176+
#endif
177+
170178
#if defined(__MINGW32__)
171179
// For unknown reasons all PYBIND11_DEPRECATED member trigger a warning when declared
172180
// whether it is used or not

0 commit comments

Comments
 (0)