Skip to content

Commit e2cf52b

Browse files
committed
Fix VS2022 build failures by adopting pybind/pybind11#3497 (a224d0c)
1 parent 003f50b commit e2cf52b

File tree

1 file changed

+8
-0
lines changed
  • pybind11/include/pybind11/detail

1 file changed

+8
-0
lines changed

pybind11/include/pybind11/detail/common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@
116116
# pragma warning(push)
117117
# pragma warning(disable: 4510 4610 4512 4005)
118118
# if defined(_DEBUG) && !defined(Py_DEBUG)
119+
// Workaround for a VS 2022 issue.
120+
// NOTE: This workaround knowingly violates the Python.h include order requirement:
121+
// https://docs.python.org/3/c-api/intro.html#include-files
122+
// See https://github.com/pybind/pybind11/pull/3497 for full context.
123+
# include <yvals.h>
124+
# if _MSVC_STL_VERSION >= 143
125+
# include <crtdefs.h>
126+
# endif
119127
# define PYBIND11_DEBUG_MARKER
120128
# undef _DEBUG
121129
# endif

0 commit comments

Comments
 (0)