From 96c10c648565c7406d5606099dbbb937310c26dc Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Mon, 26 Feb 2024 18:21:55 +0100 Subject: [PATCH] gh-115882: Reference Unknwn.h for ctypes on Windows (GH-115350) This allows the module to be compiled with WIN32_LEAN_AND_MEAN enabled --- .../next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst | 1 + Modules/_ctypes/ctypes.h | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2024-02-24-12-50-43.gh-issue-115350.naQA6y.rst 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 00000000000000..5492a804255838 --- /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 1989723f6f3dbb..02f48a9ed55843 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -32,6 +32,10 @@ #endif #endif +#ifdef MS_WIN32 +#include // for IUnknown interface +#endif + typedef struct { PyTypeObject *DictRemover_Type; PyTypeObject *PyCArg_Type;