summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuriy Chernyshov <thegeorg@yandex-team.com>2024-02-26 17:21:55 (GMT)
committerGitHub <noreply@github.com>2024-02-26 17:21:55 (GMT)
commit96c10c648565c7406d5606099dbbb937310c26dc (patch)
tree493f1d28de08c0198c0d2b6de5a6f93e507613cf
parentc0fdfba7ff981c55ac13325e4dddaf382601b246 (diff)
downloadcpython-96c10c648565c7406d5606099dbbb937310c26dc.zip
cpython-96c10c648565c7406d5606099dbbb937310c26dc.tar.gz
cpython-96c10c648565c7406d5606099dbbb937310c26dc.tar.bz2
gh-115882: Reference Unknwn.h for ctypes on Windows (GH-115350)
This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled
-rw-r--r--Misc/NEWS.d/next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst1
-rw-r--r--Modules/_ctypes/ctypes.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst b/Misc/NEWS.d/next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst
new file mode 100644
index 0000000..5492a80
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst
@@ -0,0 +1 @@
+Fix building ctypes module with -DWIN32_LEAN_AND_MEAN defined
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
index 1989723..02f48a9 100644
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -32,6 +32,10 @@
#endif
#endif
+#ifdef MS_WIN32
+#include <Unknwn.h> // for IUnknown interface
+#endif
+
typedef struct {
PyTypeObject *DictRemover_Type;
PyTypeObject *PyCArg_Type;