Skip to content

Commit 401f9f3

Browse files
committed
Fix python#13210. Port the Windows build from VS2008 to VS2010.
1 parent 708d88c commit 401f9f3

File tree

131 files changed

+25718
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+25718
-172
lines changed

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ PCbuild/*.ncb
6666
PCbuild/*.bsc
6767
PCbuild/*.user
6868
PCbuild/*.suo
69+
PCbuild/*.*sdf
6970
PCbuild/Win32-temp-*
7071
PCbuild/x64-temp-*
7172
__pycache__

Lib/distutils/command/build_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def finalize_options(self):
197197
# Append the source distribution include and library directories,
198198
# this allows distutils on windows to work in the source tree
199199
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
200-
if MSVC_VERSION == 9:
200+
if MSVC_VERSION >= 9:
201201
# Use the .lib files for the correct architecture
202202
if self.plat_name == 'win32':
203203
suffix = ''
217 KB
Binary file not shown.
187 KB
Binary file not shown.

Lib/packaging/command/build_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def finalize_options(self):
191191
# Append the source distribution include and library directories,
192192
# this allows distutils on windows to work in the source tree
193193
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
194-
if MSVC_VERSION == 9:
194+
if MSVC_VERSION >= 9:
195195
# Use the .lib files for the correct architecture
196196
if self.plat_name == 'win32':
197197
suffix = ''

Lib/packaging/compiler/msvc9compiler.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,12 @@ def link(self, target_desc, objects, output_filename, output_dir=None,
634634
mfid = 2
635635
self._remove_visual_c_ref(temp_manifest)
636636
out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
637-
try:
638-
self.spawn(['mt.exe', '-nologo', '-manifest',
639-
temp_manifest, out_arg])
640-
except PackagingExecError as msg:
641-
raise LinkError(msg)
637+
if self.__version < 10:
638+
try:
639+
self.spawn(['mt.exe', '-nologo', '-manifest',
640+
temp_manifest, out_arg])
641+
except PackagingExecError as msg:
642+
raise LinkError(msg)
642643
else:
643644
logger.debug("skipping %s (up-to-date)", output_filename)
644645

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ Tools/Demos
8080
- Issue #14695: Bring Tools/parser/unparse.py support up to date with
8181
the Python 3.3 Grammar.
8282

83+
Build
84+
-----
85+
86+
- Issue #13210: Windows build now uses VS2010, ported from VS2008.
87+
8388

8489
What's New in Python 3.3.0 Alpha 3?
8590
===================================

Modules/errnomodule.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@
77
#ifdef MS_WINDOWS
88
#define WIN32_LEAN_AND_MEAN
99
#include <windows.h>
10+
/* The following constants were added to errno.h in VS2010 but have
11+
preferred WSA equivalents. */
12+
#undef EADDRINUSE
13+
#undef EADDRNOTAVAIL
14+
#undef EAFNOSUPPORT
15+
#undef EALREADY
16+
#undef ECONNABORTED
17+
#undef ECONNREFUSED
18+
#undef ECONNRESET
19+
#undef EDESTADDRREQ
20+
#undef EHOSTUNREACH
21+
#undef EINPROGRESS
22+
#undef EISCONN
23+
#undef ELOOP
24+
#undef EMSGSIZE
25+
#undef ENETDOWN
26+
#undef ENETRESET
27+
#undef ENETUNREACH
28+
#undef ENOBUFS
29+
#undef ENOPROTOOPT
30+
#undef ENOTCONN
31+
#undef ENOTSOCK
32+
#undef EOPNOTSUPP
33+
#undef EPROTONOSUPPORT
34+
#undef EPROTOTYPE
35+
#undef ETIMEDOUT
36+
#undef EWOULDBLOCK
1037
#endif
1138

1239
/*

Objects/exceptions.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,34 @@ PyObject *PyExc_RecursionErrorInst = NULL;
23172317

23182318
#ifdef MS_WINDOWS
23192319
#include <Winsock2.h>
2320+
/* The following constants were added to errno.h in VS2010 but have
2321+
preferred WSA equivalents. */
2322+
#undef EADDRINUSE
2323+
#undef EADDRNOTAVAIL
2324+
#undef EAFNOSUPPORT
2325+
#undef EALREADY
2326+
#undef ECONNABORTED
2327+
#undef ECONNREFUSED
2328+
#undef ECONNRESET
2329+
#undef EDESTADDRREQ
2330+
#undef EHOSTUNREACH
2331+
#undef EINPROGRESS
2332+
#undef EISCONN
2333+
#undef ELOOP
2334+
#undef EMSGSIZE
2335+
#undef ENETDOWN
2336+
#undef ENETRESET
2337+
#undef ENETUNREACH
2338+
#undef ENOBUFS
2339+
#undef ENOPROTOOPT
2340+
#undef ENOTCONN
2341+
#undef ENOTSOCK
2342+
#undef EOPNOTSUPP
2343+
#undef EPROTONOSUPPORT
2344+
#undef EPROTOTYPE
2345+
#undef ETIMEDOUT
2346+
#undef EWOULDBLOCK
2347+
23202348
#if defined(WSAEALREADY) && !defined(EALREADY)
23212349
#define EALREADY WSAEALREADY
23222350
#endif

0 commit comments

Comments
 (0)