Skip to content

Commit 0c2a8a5

Browse files
committed
Fix MSVC MT/MD incompatibility in PYBIND11_BUILD_ABI
1 parent 4bb6163 commit 0c2a8a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/detail/internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ struct type_info {
292292
#endif
293293

294294
/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
295-
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
295+
/// On MSVC, mixing /MT and /MD will result in crashes. See (#4779)
296296
#ifndef PYBIND11_BUILD_ABI
297297
# if defined(__GXX_ABI_VERSION)
298298
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
299-
# elif defined(_MSC_VER)
299+
# elif defined(_MSC_VER) && defined(_MT)
300300
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
301301
# else
302302
# define PYBIND11_BUILD_ABI ""

0 commit comments

Comments
 (0)