Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental: Changes on top of PR #4953 #5411

Closed
wants to merge 8 commits into from
18 changes: 12 additions & 6 deletions include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,21 @@ struct type_info {
# endif
#endif

/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
#ifndef PYBIND11_BUILD_ABI
# if defined(__GXX_ABI_VERSION)
# if defined(__GXX_ABI_VERSION) // Linux/OSX.
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
# elif defined(_MSC_VER)
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
# elif defined(_MSC_VER) // See PR #4953.
# if defined(_MT)
# define PYBIND11_BUILD_ABI "_mt_mscver" PYBIND11_TOSTRING(_MSC_VER)
# elif defined(_MD)
# define PYBIND11_BUILD_ABI "_md_mscver" PYBIND11_TOSTRING(((int) (_MSC_VER) / 100))
# else
# error "UNEXPECTED PREPROCESSOR MACROS (MSVC): PLEASE REVISE THIS CODE."
# endif
# elif defined(__NVCOMPILER) // NVHPC (PGI-based, outdated).
# define PYBIND11_BUILD_ABI "" // This was never properly guarded.
# else
# define PYBIND11_BUILD_ABI ""
# error "UNEXPECTED PREPROCESSOR MACROS: PLEASE REVISE THIS CODE."
# endif
#endif

Expand Down