Skip to content

Commit

Permalink
Fix python#13210. Port the Windows build from VS2008 to VS2010.
Browse files Browse the repository at this point in the history
  • Loading branch information
briancurtin committed May 13, 2012
1 parent 708d88c commit 401f9f3
Show file tree
Hide file tree
Showing 131 changed files with 25,718 additions and 172 deletions.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ PCbuild/*.ncb
PCbuild/*.bsc
PCbuild/*.user
PCbuild/*.suo
PCbuild/*.*sdf
PCbuild/Win32-temp-*
PCbuild/x64-temp-*
__pycache__
Expand Down
2 changes: 1 addition & 1 deletion Lib/distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def finalize_options(self):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
if MSVC_VERSION == 9:
if MSVC_VERSION >= 9:
# Use the .lib files for the correct architecture
if self.plat_name == 'win32':
suffix = ''
Expand Down
Binary file added Lib/distutils/command/wininst-10.0-amd64.exe
Binary file not shown.
Binary file added Lib/distutils/command/wininst-10.0.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Lib/packaging/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def finalize_options(self):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
if MSVC_VERSION == 9:
if MSVC_VERSION >= 9:
# Use the .lib files for the correct architecture
if self.plat_name == 'win32':
suffix = ''
Expand Down
11 changes: 6 additions & 5 deletions Lib/packaging/compiler/msvc9compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,12 @@ def link(self, target_desc, objects, output_filename, output_dir=None,
mfid = 2
self._remove_visual_c_ref(temp_manifest)
out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
try:
self.spawn(['mt.exe', '-nologo', '-manifest',
temp_manifest, out_arg])
except PackagingExecError as msg:
raise LinkError(msg)
if self.__version < 10:
try:
self.spawn(['mt.exe', '-nologo', '-manifest',
temp_manifest, out_arg])
except PackagingExecError as msg:
raise LinkError(msg)
else:
logger.debug("skipping %s (up-to-date)", output_filename)

Expand Down
5 changes: 5 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ Tools/Demos
- Issue #14695: Bring Tools/parser/unparse.py support up to date with
the Python 3.3 Grammar.

Build
-----

- Issue #13210: Windows build now uses VS2010, ported from VS2008.


What's New in Python 3.3.0 Alpha 3?
===================================
Expand Down
27 changes: 27 additions & 0 deletions Modules/errnomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@
#ifdef MS_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
#undef EADDRINUSE
#undef EADDRNOTAVAIL
#undef EAFNOSUPPORT
#undef EALREADY
#undef ECONNABORTED
#undef ECONNREFUSED
#undef ECONNRESET
#undef EDESTADDRREQ
#undef EHOSTUNREACH
#undef EINPROGRESS
#undef EISCONN
#undef ELOOP
#undef EMSGSIZE
#undef ENETDOWN
#undef ENETRESET
#undef ENETUNREACH
#undef ENOBUFS
#undef ENOPROTOOPT
#undef ENOTCONN
#undef ENOTSOCK
#undef EOPNOTSUPP
#undef EPROTONOSUPPORT
#undef EPROTOTYPE
#undef ETIMEDOUT
#undef EWOULDBLOCK
#endif

/*
Expand Down
28 changes: 28 additions & 0 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,34 @@ PyObject *PyExc_RecursionErrorInst = NULL;

#ifdef MS_WINDOWS
#include <Winsock2.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
#undef EADDRINUSE
#undef EADDRNOTAVAIL
#undef EAFNOSUPPORT
#undef EALREADY
#undef ECONNABORTED
#undef ECONNREFUSED
#undef ECONNRESET
#undef EDESTADDRREQ
#undef EHOSTUNREACH
#undef EINPROGRESS
#undef EISCONN
#undef ELOOP
#undef EMSGSIZE
#undef ENETDOWN
#undef ENETRESET
#undef ENETUNREACH
#undef ENOBUFS
#undef ENOPROTOOPT
#undef ENOTCONN
#undef ENOTSOCK
#undef EOPNOTSUPP
#undef EPROTONOSUPPORT
#undef EPROTOTYPE
#undef ETIMEDOUT
#undef EWOULDBLOCK

#if defined(WSAEALREADY) && !defined(EALREADY)
#define EALREADY WSAEALREADY
#endif
Expand Down
Loading

0 comments on commit 401f9f3

Please sign in to comment.