mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #569753: Remove support for WIN16.
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
This commit is contained in:
parent
adfa7409f8
commit
6238d2b024
18 changed files with 102 additions and 241 deletions
|
@ -16,7 +16,7 @@
|
|||
/* The default encoding used by the platform file system APIs
|
||||
Can remain NULL for all platforms that don't have such a concept
|
||||
*/
|
||||
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T)
|
||||
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
|
||||
const char *Py_FileSystemDefaultEncoding = "mbcs";
|
||||
#else
|
||||
const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
|
||||
|
|
|
@ -20,8 +20,6 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
|
|||
};
|
||||
|
||||
|
||||
#ifdef MS_WIN32
|
||||
|
||||
/* Case insensitive string compare, to avoid any dependencies on particular
|
||||
C RTL implementations */
|
||||
|
||||
|
@ -150,7 +148,6 @@ static char *GetPythonImport (HINSTANCE hModule)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
#endif /* MS_WIN32 */
|
||||
|
||||
|
||||
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
||||
|
@ -161,7 +158,6 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
|||
|
||||
PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname);
|
||||
|
||||
#ifdef MS_WIN32
|
||||
{
|
||||
HINSTANCE hDLL = NULL;
|
||||
char pathbuf[260];
|
||||
|
@ -242,31 +238,6 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
|||
}
|
||||
p = GetProcAddress(hDLL, funcname);
|
||||
}
|
||||
#endif /* MS_WIN32 */
|
||||
#ifdef MS_WIN16
|
||||
{
|
||||
HINSTANCE hDLL;
|
||||
char pathbuf[16];
|
||||
if (strchr(pathname, '\\') == NULL &&
|
||||
strchr(pathname, '/') == NULL)
|
||||
{
|
||||
/* Prefix bare filename with ".\" */
|
||||
PyOS_snprintf(pathbuf, sizeof(pathbuf),
|
||||
".\\%-.13s", pathname);
|
||||
pathname = pathbuf;
|
||||
}
|
||||
hDLL = LoadLibrary(pathname);
|
||||
if (hDLL < HINSTANCE_ERROR){
|
||||
char errBuf[256];
|
||||
PyOS_snprintf(errBuf, sizeof(errBuf),
|
||||
"DLL load failed with error code %d",
|
||||
hDLL);
|
||||
PyErr_SetString(PyExc_ImportError, errBuf);
|
||||
return NULL;
|
||||
}
|
||||
p = GetProcAddress(hDLL, funcname);
|
||||
}
|
||||
#endif /* MS_WIN16 */
|
||||
|
||||
return p;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ extern char *strerror(int);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
#include "windows.h"
|
||||
#include "winbase.h"
|
||||
#endif
|
||||
|
@ -267,7 +267,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
|||
#ifdef PLAN9
|
||||
char errbuf[ERRMAX];
|
||||
#endif
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
char *s_buf = NULL;
|
||||
#endif
|
||||
#ifdef EINTR
|
||||
|
@ -281,7 +281,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
|||
if (i == 0)
|
||||
s = "Error"; /* Sometimes errno didn't get set */
|
||||
else
|
||||
#ifndef MS_WIN32
|
||||
#ifndef MS_WINDOWS
|
||||
s = strerror(i);
|
||||
#else
|
||||
{
|
||||
|
@ -322,7 +322,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
|
|||
PyErr_SetObject(exc, v);
|
||||
Py_DECREF(v);
|
||||
}
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
LocalFree(s_buf);
|
||||
#endif
|
||||
return NULL;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "Python.h"
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
extern void PyWinFreeze_ExeInit(void);
|
||||
extern void PyWinFreeze_ExeTerm(void);
|
||||
extern int PyInitFrozenExtensions(void);
|
||||
|
@ -32,12 +32,12 @@ Py_FrozenMain(int argc, char **argv)
|
|||
setbuf(stderr, (char *)NULL);
|
||||
}
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
PyInitFrozenExtensions();
|
||||
#endif /* MS_WIN32 */
|
||||
#endif /* MS_WINDOWS */
|
||||
Py_SetProgramName(argv[0]);
|
||||
Py_Initialize();
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
PyWinFreeze_ExeInit();
|
||||
#endif
|
||||
|
||||
|
@ -60,7 +60,7 @@ Py_FrozenMain(int argc, char **argv)
|
|||
if (inspect && isatty((int)fileno(stdin)))
|
||||
sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
PyWinFreeze_ExeTerm();
|
||||
#endif
|
||||
Py_Finalize();
|
||||
|
|
|
@ -88,7 +88,7 @@ static const struct filedescr _PyImport_StandardFiletab[] = {
|
|||
#else
|
||||
static const struct filedescr _PyImport_StandardFiletab[] = {
|
||||
{".py", "U", PY_SOURCE},
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
{".pyw", "U", PY_SOURCE},
|
||||
#endif
|
||||
{".pyc", "rb", PY_COMPILED},
|
||||
|
@ -548,7 +548,7 @@ make_compiled_pathname(char *pathname, char *buf, size_t buflen)
|
|||
if (len+2 > buflen)
|
||||
return NULL;
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
/* Treat .pyw as if it were .py. The case of ".pyw" must match
|
||||
that used in _PyImport_StandardFiletab. */
|
||||
if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0)
|
||||
|
@ -1156,7 +1156,7 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
|
|||
/* First we may need a pile of platform-specific header files; the sequence
|
||||
* of #if's here should match the sequence in the body of case_ok().
|
||||
*/
|
||||
#if defined(MS_WIN32) || defined(__CYGWIN__)
|
||||
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
|
||||
#include <windows.h>
|
||||
#ifdef __CYGWIN__
|
||||
#include <sys/cygwin.h>
|
||||
|
@ -1189,8 +1189,8 @@ case_ok(char *buf, int len, int namelen, char *name)
|
|||
* match the sequence just above.
|
||||
*/
|
||||
|
||||
/* MS_WIN32 || __CYGWIN__ */
|
||||
#if defined(MS_WIN32) || defined(__CYGWIN__)
|
||||
/* MS_WINDOWS || __CYGWIN__ */
|
||||
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE h;
|
||||
#ifdef __CYGWIN__
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
#undef BYTE
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
@ -1272,14 +1272,14 @@ Py_FatalError(char *msg)
|
|||
#ifdef macintosh
|
||||
for (;;);
|
||||
#endif
|
||||
#ifdef MS_WIN32
|
||||
#ifdef MS_WINDOWS
|
||||
OutputDebugString("Fatal Python error: ");
|
||||
OutputDebugString(msg);
|
||||
OutputDebugString("\n");
|
||||
#ifdef _DEBUG
|
||||
DebugBreak();
|
||||
#endif
|
||||
#endif /* MS_WIN32 */
|
||||
#endif /* MS_WINDOWS */
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
@ -687,7 +687,6 @@ exc_traceback -- traceback of exception currently being handled\n\
|
|||
because it is thread-safe.\n\
|
||||
"
|
||||
)
|
||||
#ifndef MS_WIN16
|
||||
/* concatenating string here */
|
||||
PyDoc_STR(
|
||||
"\n\
|
||||
|
@ -737,7 +736,6 @@ setrecursionlimit() -- set the max recursion depth for the interpreter\n\
|
|||
settrace() -- set the global debug tracing function\n\
|
||||
"
|
||||
)
|
||||
#endif /* MS_WIN16 */
|
||||
/* end of sys_doc */ ;
|
||||
|
||||
PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue