Drop support for Windows 2000; allow any XP API (but not Vista+).

Drop SDK version configuration for Tk compilation, to not bind it to W2k
anymore. Binding it to XP would conflict with Tk's own binding of tkMenu to W2k.
This commit is contained in:
Martin v. Löwis 2013-01-25 14:06:18 +01:00
parent 6951fea3ab
commit 3f50bf652b
6 changed files with 16 additions and 51 deletions

View File

@ -746,6 +746,8 @@ Tests
Build Build
----- -----
- Drop support for Windows 2000.
- Issue #17029: Let h2py search the multiarch system include directory. - Issue #17029: Let h2py search the multiarch system include directory.
- Issue #16953: Fix socket module compilation on platforms with - Issue #16953: Fix socket module compilation on platforms with

View File

@ -156,15 +156,9 @@ WIN32 is still required for the locale module.
#endif /* MS_WIN64 */ #endif /* MS_WIN64 */
/* set the version macros for the windows headers */ /* set the version macros for the windows headers */
#ifdef MS_WINX64 /* Python 3.4+ requires Windows XP or greater */
/* 64 bit only runs on XP or greater */
#define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */ #define Py_WINVER 0x0501 /* _WIN32_WINNT_WINXP */
#define Py_NTDDI NTDDI_WINXP #define Py_NTDDI NTDDI_WINXP
#else
/* Python 2.6+ requires Windows 2000 or greater */
#define Py_WINVER 0x0500 /* _WIN32_WINNT_WIN2K */
#define Py_NTDDI NTDDI_WIN2KSP4
#endif
/* We only set these values when building Python - we don't want to force /* We only set these values when building Python - we don't want to force
these values on extensions, as that will affect the prototypes and these values on extensions, as that will affect the prototypes and

View File

@ -16,11 +16,7 @@ TK = "tk8.5.11"
TIX = "tix-8.4.3.x" TIX = "tix-8.4.3.x"
ROOT = os.path.abspath(os.path.join(here, par, par)) ROOT = os.path.abspath(os.path.join(here, par, par))
# Windows 2000 compatibility: WINVER 0x0500 NMAKE = ('nmake /nologo /f %s %s %s')
# http://msdn2.microsoft.com/en-us/library/aa383745.aspx
NMAKE = ('nmake /nologo /f %s '
'COMPILERFLAGS=\"-DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DNTDDI_VERSION=NTDDI_WIN2KSP4\" '
'%s %s')
def nmake(makefile, command="", **kw): def nmake(makefile, command="", **kw):
defines = ' '.join(k+'='+str(v) for k, v in kw.items()) defines = ' '.join(k+'='+str(v) for k, v in kw.items())

View File

@ -12,13 +12,6 @@ static int _Py_HashSecret_Initialized = 0;
#endif #endif
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv,\
LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType,\
DWORD dwFlags );
typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen,\
BYTE *pbBuffer );
static CRYPTGENRANDOM pCryptGenRandom = NULL;
/* This handle is never explicitly released. Instead, the operating /* This handle is never explicitly released. Instead, the operating
system will release it when the process terminates. */ system will release it when the process terminates. */
static HCRYPTPROV hCryptProv = 0; static HCRYPTPROV hCryptProv = 0;
@ -26,29 +19,9 @@ static HCRYPTPROV hCryptProv = 0;
static int static int
win32_urandom_init(int raise) win32_urandom_init(int raise)
{ {
HINSTANCE hAdvAPI32 = NULL;
CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
/* Obtain handle to the DLL containing CryptoAPI. This should not fail. */
hAdvAPI32 = GetModuleHandle("advapi32.dll");
if(hAdvAPI32 == NULL)
goto error;
/* Obtain pointers to the CryptoAPI functions. This will fail on some early
versions of Win95. */
pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(
hAdvAPI32, "CryptAcquireContextA");
if (pCryptAcquireContext == NULL)
goto error;
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32,
"CryptGenRandom");
if (pCryptGenRandom == NULL)
goto error;
/* Acquire context */ /* Acquire context */
if (! pCryptAcquireContext(&hCryptProv, NULL, NULL, if (!CryptAcquireContext(&hCryptProv, NULL, NULL,
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
goto error; goto error;
return 0; return 0;
@ -77,7 +50,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
while (size > 0) while (size > 0)
{ {
chunk = size > INT_MAX ? INT_MAX : size; chunk = size > INT_MAX ? INT_MAX : size;
if (!pCryptGenRandom(hCryptProv, chunk, buffer)) if (!CryptGenRandom(hCryptProv, chunk, buffer))
{ {
/* CryptGenRandom() failed */ /* CryptGenRandom() failed */
if (raise) if (raise)

View File

@ -6,16 +6,16 @@ call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
if not exist tcltk64\bin\tcl85g.dll ( if not exist tcltk64\bin\tcl85g.dll (
cd tcl-8.5.11.0\win cd tcl-8.5.11.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
cd ..\.. cd ..\..
) )
if not exist tcltk64\bin\tk85g.dll ( if not exist tcltk64\bin\tk85g.dll (
cd tk-8.5.11.0\win cd tk-8.5.11.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 clean nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 clean
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 all nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 all
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 install nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.5.11.0 install
cd ..\.. cd ..\..
) )

View File

@ -7,15 +7,15 @@ call "%VS100COMNTOOLS%\vsvars32.bat"
if not exist tcltk\bin\tcl85g.dll ( if not exist tcltk\bin\tcl85g.dll (
@rem all and install need to be separate invocations, otherwise nmakehlp is not found on install @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install
cd tcl-8.5.11.0\win cd tcl-8.5.11.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 DEBUG=1 INSTALLDIR=..\..\tcltk clean all nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk clean all
nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
cd ..\.. cd ..\..
) )
if not exist tcltk\bin\tk85g.dll ( if not exist tcltk\bin\tk85g.dll (
cd tk-8.5.11.0\win cd tk-8.5.11.0\win
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 clean nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 clean
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 all nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 all
nmake -f makefile.vc COMPILERFLAGS=-DWINVER=0x0500 OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 install nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.5.11.0 install
cd ..\.. cd ..\..
) )