summarylogtreecommitdiffstats
path: root/0021-MINGW-setup-msvcrt-and-_winapi-modules.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0021-MINGW-setup-msvcrt-and-_winapi-modules.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0021-MINGW-setup-msvcrt-and-_winapi-modules.patch')
-rw-r--r--0021-MINGW-setup-msvcrt-and-_winapi-modules.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/0021-MINGW-setup-msvcrt-and-_winapi-modules.patch b/0021-MINGW-setup-msvcrt-and-_winapi-modules.patch
new file mode 100644
index 000000000000..edb701458af4
--- /dev/null
+++ b/0021-MINGW-setup-msvcrt-and-_winapi-modules.patch
@@ -0,0 +1,93 @@
+From 71342683a28f2826c9738951706c167226c2f093 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:51:33 +0530
+Subject: [PATCH 021/N] MINGW setup msvcrt and _winapi modules
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+---
+ Modules/_winapi.c | 2 ++
+ PC/msvcrtmodule.c | 2 ++
+ Python/dynamic_annotations.c | 2 +-
+ setup.py | 21 +++++++++++++++++++++
+ 4 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/Modules/_winapi.c b/Modules/_winapi.c
+index 1e0e4ec..1058184 100644
+--- a/Modules/_winapi.c
++++ b/Modules/_winapi.c
+@@ -39,7 +39,9 @@
+
+ #define WINDOWS_LEAN_AND_MEAN
+ #include "windows.h"
++#if defined(Py_DEBUG)
+ #include <crtdbg.h>
++#endif
+ #include "winreparse.h"
+
+ #if defined(MS_WIN32) && !defined(MS_WIN64)
+diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
+index faceb03..28e1957 100644
+--- a/PC/msvcrtmodule.c
++++ b/PC/msvcrtmodule.c
+@@ -21,7 +21,9 @@
+ #include <io.h>
+ #include <conio.h>
+ #include <sys/locking.h>
++#ifdef _DEBUG
+ #include <crtdbg.h>
++#endif
+ #include <windows.h>
+
+ #ifdef _MSC_VER
+diff --git a/Python/dynamic_annotations.c b/Python/dynamic_annotations.c
+index 7febaa0..70d5b3d 100644
+--- a/Python/dynamic_annotations.c
++++ b/Python/dynamic_annotations.c
+@@ -27,7 +27,7 @@
+ * Author: Kostya Serebryany
+ */
+
+-#ifdef _MSC_VER
++#ifdef MS_WINDOWS
+ # include <windows.h>
+ #endif
+
+diff --git a/setup.py b/setup.py
+index f317bf3..5466e9b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1604,6 +1604,27 @@ class PyBuildExt(build_ext):
+ '-framework', 'SystemConfiguration',
+ '-framework', 'CoreFoundation']))
+
++ # Modules with some Windows dependencies:
++ if MS_WINDOWS:
++ srcdir = sysconfig.get_config_var('srcdir')
++ pc_srcdir = os.path.abspath(os.path.join(srcdir, 'PC'))
++
++ self.add(Extension('msvcrt', [os.path.join(pc_srcdir, p)
++ for p in ['msvcrtmodule.c']]))
++
++ self.add(Extension('_winapi', ['_winapi.c']))
++
++ self.add(Extension('_msi', [os.path.join(pc_srcdir, p)
++ for p in ['_msi.c']],
++ libraries=['msi','cabinet','rpcrt4'])) # To link with lib(msi|cabinet|rpcrt4).a
++
++ self.add(Extension('winsound', [os.path.join(pc_srcdir, p)
++ for p in ['winsound.c']],
++ libraries=['winmm']))
++
++ self.add(Extension('_overlapped', ['overlapped.c'],
++ libraries=['ws2_32']))
++
+ def detect_compress_exts(self):
+ # Andrew Kuchling's zlib module. Note that some versions of zlib
+ # 1.1.3 have security problems. See CERT Advisory CA-2002-07:
+--
+2.33.0
+