Skip to content

2.7.18.10 dev #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: 2.7.18.x_old
Choose a base branch
from
Prev Previous commit
Next Next commit
Update Windows to support VC 14.0
  • Loading branch information
icanhasmath committed Aug 9, 2024
commit fe0377e02e004b2d212af6f540e0b15a019e729d
6 changes: 5 additions & 1 deletion Lib/ctypes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def _get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
majorVersion += 1
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the comment in all the other places this was done. Still not sure I understand it, but a reason was given.

minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand All @@ -36,8 +38,10 @@ def find_msvcrt():
return None
if version <= 6:
clibname = 'msvcrt'
else:
elif version <= 13:
clibname = 'msvcr%d' % (version * 10)
else:
clibname = 'appcrt%d' % (version * 10)

# If python was built with in debug mode
import imp
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 @@ -196,7 +196,7 @@ def finalize_options(self):
if MSVC_VERSION >= 9:
# Use the .lib files for the correct architecture
if self.plat_name == 'win32':
suffix = ''
suffix = 'win32'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves suffix undefined in certain circumstances.

else:
# win-amd64 or win-ia64
suffix = self.plat_name[4:]
Expand Down
3 changes: 3 additions & 0 deletions Lib/distutils/msvc9compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ def get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
# v13 was skipped and should be v14
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand Down
3 changes: 3 additions & 0 deletions Lib/distutils/msvccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def get_build_version():
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
if majorVersion >= 13:
# v13 was skipped and should be v14
majorVersion += 1
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
Expand Down
29 changes: 6 additions & 23 deletions PC/bdist_wininst/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ static void CenterWindow(HWND hwnd)

#include <prsht.h>

BOOL CALLBACK
INT_PTR CALLBACK
IntroDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1534,7 +1534,7 @@ SCHEME *GetScheme(int major, int minor)
return old_scheme;
}

BOOL CALLBACK
INT_PTR CALLBACK
SelectPythonDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1836,7 +1836,7 @@ static void CloseLogfile(void)
fclose(logfile);
}

BOOL CALLBACK
INT_PTR CALLBACK
InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -1991,7 +1991,7 @@ InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}


BOOL CALLBACK
INT_PTR CALLBACK
FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnm;
Expand Down Expand Up @@ -2167,23 +2167,6 @@ BOOL NeedAutoUAC()
return TRUE;
}

// Returns TRUE if the platform supports UAC.
BOOL PlatformSupportsUAC()
{
// Note that win2k does seem to support ShellExecute with 'runas',
// but does *not* support IsUserAnAdmin - so we just pretend things
// only work on XP and later.
BOOL bIsWindowsXPorLater;
OSVERSIONINFO winverinfo;
winverinfo.dwOSVersionInfoSize = sizeof(winverinfo);
if (!GetVersionEx(&winverinfo))
return FALSE; // something bad has gone wrong
bIsWindowsXPorLater =
( (winverinfo.dwMajorVersion > 5) ||
( (winverinfo.dwMajorVersion == 5) && (winverinfo.dwMinorVersion >= 1) ));
return bIsWindowsXPorLater;
}

// Spawn ourself as an elevated application. On failure, a message is
// displayed to the user - but this app will always terminate, even
// on error.
Expand Down Expand Up @@ -2239,15 +2222,15 @@ int DoInstall(void)

// See if we need to do the Vista UAC magic.
if (strcmp(user_access_control, "force")==0) {
if (PlatformSupportsUAC() && !MyIsUserAnAdmin()) {
if (!MyIsUserAnAdmin()) {
SpawnUAC();
return 0;
}
// already admin - keep going
} else if (strcmp(user_access_control, "auto")==0) {
// Check if it looks like we need UAC control, based
// on how Python itself was installed.
if (PlatformSupportsUAC() && !MyIsUserAnAdmin() && NeedAutoUAC()) {
if (!MyIsUserAnAdmin() && NeedAutoUAC()) {
SpawnUAC();
return 0;
}
Expand Down
7 changes: 7 additions & 0 deletions PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ typedef int pid_t;
#define Py_IS_FINITE(X) _finite(X)
#define copysign _copysign

/* VS 2015 defines these names with a leading underscore */
#if _MSC_VER >= 1900
#define timezone _timezone
#define daylight _daylight
#define tzname _tzname
#endif

/* Side by Side assemblies supported in VS 2005 and VS 2008 but not 2010*/
#if _MSC_VER >= 1400 && _MSC_VER < 1600
#define HAVE_SXS 1
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy