summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/clingo/vs2022.patch
blob: 8a27fc8679dac41aa11db479fd219f3eec970d47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/libpyclingo/pyclingo.cc b/libpyclingo/pyclingo.cc
index 88b6669..58e73bd 100644
--- a/libpyclingo/pyclingo.cc
+++ b/libpyclingo/pyclingo.cc
@@ -25,6 +25,13 @@
 // NOTE: the python header has a linker pragma to link with python_d.lib
 //       when _DEBUG is set which is not part of official python releases
 #if defined(_MSC_VER) && defined(_DEBUG) && !defined(CLINGO_UNDEF__DEBUG)
+// Workaround for a VS 2022 issue.
+// NOTE: This workaround knowingly violates the Python.h include order requirement:
+// https://docs.python.org/3/c-api/intro.html#include-files
+#   include <yvals.h>
+# if _MSVC_STL_VERSION >= 143
+#   include <crtdefs.h>
+# endif
 #undef _DEBUG
 #include <Python.h>
 #define _DEBUG