Skip to content

Commit 607812a

Browse files
committed
Fix MSVC MT/MD incompatibility in PYBIND11_BUILD_ABI
1 parent 7e418f4 commit 607812a

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
@@ -311,11 +311,11 @@ struct type_info {
311311
#endif
312312

313313
/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility.
314-
/// On MSVC, changes in _MSC_VER may indicate ABI incompatibility (#2898).
314+
/// On MSVC, mixing /MT and /MD will result in crashes. See (#4779)
315315
#ifndef PYBIND11_BUILD_ABI
316316
# if defined(__GXX_ABI_VERSION)
317317
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION)
318-
# elif defined(_MSC_VER)
318+
# elif defined(_MSC_VER) && defined(_MT)
319319
# define PYBIND11_BUILD_ABI "_mscver" PYBIND11_TOSTRING(_MSC_VER)
320320
# else
321321
# define PYBIND11_BUILD_ABI ""

0 commit comments

Comments
 (0)