Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,22 @@
// In contrast, FORWARD DECLARATIONS should never use this macro:
// https://stackoverflow.com/questions/9317473/forward-declaration-of-inline-functions
#if defined(PYBIND11_NOINLINE_DISABLED) // Option for maximum portability and experimentation.
# define PYBIND11_NOINLINE inline
# define PYBIND11_NOINLINE_ATTR
#elif defined(_MSC_VER)
# define PYBIND11_NOINLINE __declspec(noinline) inline
# define PYBIND11_NOINLINE_ATTR __declspec(noinline)
#else
# define PYBIND11_NOINLINE __attribute__((noinline)) inline
# define PYBIND11_NOINLINE_ATTR __attribute__((noinline))
#endif
#define PYBIND11_NOINLINE PYBIND11_NOINLINE_ATTR inline

// PYBIND11_INLINE marks function definitions that live in a `-inl.h` file. It is `inline` in
// the default header-only mode. Defining PYBIND11_PRECOMPILED makes it empty: the definitions
// are then compiled once (into a static library linked into each extension module) and the
// headers only provide declarations.
#if defined(PYBIND11_PRECOMPILED)
# define PYBIND11_INLINE
#else
# define PYBIND11_INLINE inline
#endif

#if defined(_MSC_VER)
Expand Down
Loading