Skip to content

Commit 76b8858

Browse files
authored
fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (pybind#2898) (pybind#4779)
1 parent b9359ce commit 76b8858

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/pybind11/detail/internals.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,12 @@ struct type_info {
291291
#endif
292292

293293
/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
294+
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
294295
#ifndef PYBIND11_BUILD_ABI
295296
# if defined(__GXX_ABI_VERSION)
296297
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
298+
# elif defined(_MSC_VER)
299+
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
297300
# else
298301
# define PYBIND11_BUILD_ABI ""
299302
# endif

0 commit comments

Comments
 (0)