diff -rupN --no-dereference Python-3.10.0rc1/Modules/Setup Python-3.10.0rc1-new/Modules/Setup
--- Python-3.10.0rc1/Modules/Setup 2021-08-02 21:53:59.000000000 +0200
+++ Python-3.10.0rc1-new/Modules/Setup 2021-08-04 16:36:59.637355020 +0200
@@ -123,7 +123,7 @@ _thread -DPy_BUILD_CORE_BUILTIN -I$(srcd
_locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl
# Standard I/O baseline
-_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
+_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c
# faulthandler module
faulthandler faulthandler.c
diff -rupN --no-dereference Python-3.10.0rc1/Modules/_winapi.c Python-3.10.0rc1-new/Modules/_winapi.c
--- Python-3.10.0rc1/Modules/_winapi.c 2021-08-04 16:36:57.623375343 +0200
+++ Python-3.10.0rc1-new/Modules/_winapi.c 2021-08-04 16:36:59.637355020 +0200
@@ -41,7 +41,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 -rupN --no-dereference Python-3.10.0rc1/PC/msvcrtmodule.c Python-3.10.0rc1-new/PC/msvcrtmodule.c
--- Python-3.10.0rc1/PC/msvcrtmodule.c 2021-08-02 21:53:59.000000000 +0200
+++ Python-3.10.0rc1-new/PC/msvcrtmodule.c 2021-08-04 16:36:59.637355020 +0200
@@ -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 -rupN --no-dereference Python-3.10.0rc1/Python/dynamic_annotations.c Python-3.10.0rc1-new/Python/dynamic_annotations.c
--- Python-3.10.0rc1/Python/dynamic_annotations.c 2021-08-02 21:53:59.000000000 +0200
+++ Python-3.10.0rc1-new/Python/dynamic_annotations.c 2021-08-04 16:36:59.637355020 +0200
@@ -27,7 +27,7 @@
* Author: Kostya Serebryany
*/
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
# include <windows.h>
#endif
diff -rupN --no-dereference Python-3.10.0rc1/setup.py Python-3.10.0rc1-new/setup.py
--- Python-3.10.0rc1/setup.py 2021-08-04 16:36:58.743364037 +0200
+++ Python-3.10.0rc1-new/setup.py 2021-08-04 16:36:59.638355009 +0200
@@ -1254,6 +1254,24 @@ class PyBuildExt(build_ext):
min_db_ver = (3, 3)
db_setup_debug = False # verbose debug prints from this script?
+ # Modules with some Windows dependencies:
+ if HOST_PLATFORM.startswith(('mingw', 'win')):
+ 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']) )
+
def allow_db_ver(db_ver):
"""Returns a boolean if the given BerkeleyDB version is acceptable.
@@ -1660,6 +1678,10 @@ class PyBuildExt(build_ext):
'-framework', 'SystemConfiguration',
'-framework', 'CoreFoundation']))
+ if HOST_PLATFORM.startswith(('mingw', 'win')):
+ 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: