summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c2
-rw-r--r--Python/dynload_win.c29
-rw-r--r--Python/errors.c8
-rw-r--r--Python/frozenmain.c10
-rw-r--r--Python/import.c10
-rw-r--r--Python/pythonrun.c6
-rw-r--r--Python/sysmodule.c2
7 files changed, 18 insertions, 49 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 7126391..fec7554 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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 */
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index 9062cf3..7178962 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -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;
}
diff --git a/Python/errors.c b/Python/errors.c
index 265e5bb..f744ad4 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -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;
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 21724ef..397f046 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -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();
diff --git a/Python/import.c b/Python/import.c
index 9efd3ea..6fd05d8 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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__
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 324bc89..63e0e8e 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -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();
}
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 66fceca..549bbec 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -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 *