aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-02-27 01:51:42 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-02-27 02:04:39 +0300
commit6fa64684d15341dd701bf1498ecafdd764d5f097 (patch)
tree344e0ac8f1a41f7553078a303fac90d6e76312ad
parent513c484bfeaa01ce1ac67ef6146d03c08a7d3b4d (diff)
downloadydb-6fa64684d15341dd701bf1498ecafdd764d5f097.tar.gz
Better patch around #include <Unknwn.h>
Backport of [PR #115350](https://github.com/python/cpython/pull/115350.patch) from CPython upstream. 7a2729f31048ba63762a6d3a890308c23db5c969
-rw-r--r--contrib/tools/python3/Modules/_ctypes/_ctypes.c1
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callbacks.c1
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callproc.c1
-rw-r--r--contrib/tools/python3/Modules/_ctypes/cfield.c1
-rw-r--r--contrib/tools/python3/Modules/_ctypes/ctypes.h4
-rw-r--r--contrib/tools/python3/Modules/_ctypes/stgdict.c1
-rw-r--r--contrib/tools/python3/patches/all-changes.patch50
7 files changed, 4 insertions, 55 deletions
diff --git a/contrib/tools/python3/Modules/_ctypes/_ctypes.c b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
index 05de939b7a..c5157560f6 100644
--- a/contrib/tools/python3/Modules/_ctypes/_ctypes.c
+++ b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
@@ -107,7 +107,6 @@ bytes(cdata)
// windows.h must be included before pycore internal headers
#ifdef MS_WIN32
# include <windows.h>
-# include <Unknwn.h>
#endif
#include "pycore_call.h" // _PyObject_CallNoArgs()
diff --git a/contrib/tools/python3/Modules/_ctypes/callbacks.c b/contrib/tools/python3/Modules/_ctypes/callbacks.c
index 58f6249f8d..d71297f9c5 100644
--- a/contrib/tools/python3/Modules/_ctypes/callbacks.c
+++ b/contrib/tools/python3/Modules/_ctypes/callbacks.c
@@ -6,7 +6,6 @@
// windows.h must be included before pycore internal headers
#ifdef MS_WIN32
# include <windows.h>
-# include <Unknwn.h>
#endif
#include "pycore_call.h" // _PyObject_CallNoArgs()
diff --git a/contrib/tools/python3/Modules/_ctypes/callproc.c b/contrib/tools/python3/Modules/_ctypes/callproc.c
index b46ccc2d86..d2fe525dd4 100644
--- a/contrib/tools/python3/Modules/_ctypes/callproc.c
+++ b/contrib/tools/python3/Modules/_ctypes/callproc.c
@@ -65,7 +65,6 @@
#ifdef MS_WIN32
#include <windows.h>
-#include <Unknwn.h>
#include <tchar.h>
#else
#include <dlfcn.h>
diff --git a/contrib/tools/python3/Modules/_ctypes/cfield.c b/contrib/tools/python3/Modules/_ctypes/cfield.c
index ebca11e596..128506a9ee 100644
--- a/contrib/tools/python3/Modules/_ctypes/cfield.c
+++ b/contrib/tools/python3/Modules/_ctypes/cfield.c
@@ -6,7 +6,6 @@
// windows.h must be included before pycore internal headers
#ifdef MS_WIN32
# include <windows.h>
-# include <Unknwn.h>
#endif
#include "pycore_bitutils.h" // _Py_bswap32()
diff --git a/contrib/tools/python3/Modules/_ctypes/ctypes.h b/contrib/tools/python3/Modules/_ctypes/ctypes.h
index 8891a0a741..aed4dffe07 100644
--- a/contrib/tools/python3/Modules/_ctypes/ctypes.h
+++ b/contrib/tools/python3/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;
diff --git a/contrib/tools/python3/Modules/_ctypes/stgdict.c b/contrib/tools/python3/Modules/_ctypes/stgdict.c
index 57f4b0040c..ae3f356c2e 100644
--- a/contrib/tools/python3/Modules/_ctypes/stgdict.c
+++ b/contrib/tools/python3/Modules/_ctypes/stgdict.c
@@ -6,7 +6,6 @@
// windows.h must be included before pycore internal headers
#ifdef MS_WIN32
# include <windows.h>
-# include <Unknwn.h>
#endif
#include "pycore_call.h" // _PyObject_CallNoArgs()
diff --git a/contrib/tools/python3/patches/all-changes.patch b/contrib/tools/python3/patches/all-changes.patch
index cc1ae0b16e..9927d22ac6 100644
--- a/contrib/tools/python3/patches/all-changes.patch
+++ b/contrib/tools/python3/patches/all-changes.patch
@@ -183,56 +183,6 @@
-1, -1, -1, -1, -1, -1, errpipe_read, errpipe_write,
False, False, -1, None, None, None, -1, None,
subprocess._USE_VFORK)
---- contrib/tools/python3/Modules/_ctypes/_ctypes.c (index)
-+++ contrib/tools/python3/Modules/_ctypes/_ctypes.c (working tree)
-@@ -109,6 +109,7 @@ bytes(cdata)
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
---- contrib/tools/python3/Modules/_ctypes/callbacks.c (index)
-+++ contrib/tools/python3/Modules/_ctypes/callbacks.c (working tree)
-@@ -7,6 +7,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
---- contrib/tools/python3/Modules/_ctypes/callproc.c (index)
-+++ contrib/tools/python3/Modules/_ctypes/callproc.c (working tree)
-@@ -63,6 +63,7 @@
-
- #ifdef MS_WIN32
- #include <windows.h>
-+#include <Unknwn.h>
- #include <tchar.h>
- #else
- #include "ctypes_dlfcn.h"
---- contrib/tools/python3/Modules/_ctypes/cfield.c (index)
-+++ contrib/tools/python3/Modules/_ctypes/cfield.c (working tree)
-@@ -6,6 +6,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_bitutils.h" // _Py_bswap32()
---- contrib/tools/python3/Modules/_ctypes/stgdict.c (index)
-+++ contrib/tools/python3/Modules/_ctypes/stgdict.c (working tree)
-@@ -7,6 +7,7 @@
- // windows.h must be included before pycore internal headers
- #ifdef MS_WIN32
- # include <windows.h>
-+# include <Unknwn.h>
- #endif
-
- #include "pycore_call.h" // _PyObject_CallNoArgs()
--- contrib/tools/python3/Modules/_decimal/libmpdec/io.c (index)
+++ contrib/tools/python3/Modules/_decimal/libmpdec/io.c (working tree)
@@ -37,7 +37,7 @@