Patch #569753: Remove support for WIN16.

Rename all occurrences of MS_WIN32 to MS_WINDOWS.
This commit is contained in:
Martin v. Löwis 2002-06-30 15:26:10 +00:00
parent adfa7409f8
commit 6238d2b024
18 changed files with 102 additions and 241 deletions

View File

@ -316,7 +316,7 @@ charmap_decode(PyObject *self,
size); size);
} }
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T) #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
static PyObject * static PyObject *
mbcs_decode(PyObject *self, mbcs_decode(PyObject *self,
@ -334,7 +334,7 @@ mbcs_decode(PyObject *self,
size); size);
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
/* --- Encoder ------------------------------------------------------------ */ /* --- Encoder ------------------------------------------------------------ */
@ -636,7 +636,7 @@ charmap_encode(PyObject *self,
return v; return v;
} }
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T) #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
static PyObject * static PyObject *
mbcs_encode(PyObject *self, mbcs_encode(PyObject *self,
@ -661,7 +661,7 @@ mbcs_encode(PyObject *self,
return v; return v;
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#endif /* Py_USING_UNICODE */ #endif /* Py_USING_UNICODE */
/* --- Module API --------------------------------------------------------- */ /* --- Module API --------------------------------------------------------- */
@ -695,7 +695,7 @@ static PyMethodDef _codecs_functions[] = {
{"charmap_decode", charmap_decode, METH_VARARGS}, {"charmap_decode", charmap_decode, METH_VARARGS},
{"readbuffer_encode", readbuffer_encode, METH_VARARGS}, {"readbuffer_encode", readbuffer_encode, METH_VARARGS},
{"charbuffer_encode", charbuffer_encode, METH_VARARGS}, {"charbuffer_encode", charbuffer_encode, METH_VARARGS},
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T) #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
{"mbcs_encode", mbcs_encode, METH_VARARGS}, {"mbcs_encode", mbcs_encode, METH_VARARGS},
{"mbcs_decode", mbcs_decode, METH_VARARGS}, {"mbcs_decode", mbcs_decode, METH_VARARGS},
#endif #endif

View File

@ -12,7 +12,7 @@
* Which timer to use should be made more configurable, but that should not * Which timer to use should be made more configurable, but that should not
* be difficult. This will do for now. * be difficult. This will do for now.
*/ */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
#include <direct.h> /* for getcwd() */ #include <direct.h> /* for getcwd() */
typedef __int64 hs_time; typedef __int64 hs_time;
@ -90,7 +90,7 @@ typedef struct {
static PyObject * ProfilerError = NULL; static PyObject * ProfilerError = NULL;
#ifndef MS_WIN32 #ifndef MS_WINDOWS
#ifdef GETTIMEOFDAY_NO_TZ #ifdef GETTIMEOFDAY_NO_TZ
#define GETTIMEOFDAY(ptv) gettimeofday((ptv)) #define GETTIMEOFDAY(ptv) gettimeofday((ptv))
#else #else
@ -818,7 +818,7 @@ static inline int
get_tdelta(ProfilerObject *self) get_tdelta(ProfilerObject *self)
{ {
int tdelta; int tdelta;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
hs_time tv; hs_time tv;
hs_time diff; hs_time diff;
@ -909,7 +909,7 @@ tracer_callback(ProfilerObject *self, PyFrameObject *frame, int what,
/* A couple of useful helper functions. */ /* A couple of useful helper functions. */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
static LARGE_INTEGER frequency = {0, 0}; static LARGE_INTEGER frequency = {0, 0};
#endif #endif
@ -921,7 +921,7 @@ calibrate(void)
{ {
hs_time tv1, tv2; hs_time tv1, tv2;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
hs_time diff; hs_time diff;
QueryPerformanceFrequency(&frequency); QueryPerformanceFrequency(&frequency);
#endif #endif
@ -929,7 +929,7 @@ calibrate(void)
GETTIMEOFDAY(&tv1); GETTIMEOFDAY(&tv1);
while (1) { while (1) {
GETTIMEOFDAY(&tv2); GETTIMEOFDAY(&tv2);
#ifdef MS_WIN32 #ifdef MS_WINDOWS
diff = tv2 - tv1; diff = tv2 - tv1;
if (diff != 0) { if (diff != 0) {
timeofday_diff = (unsigned long)diff; timeofday_diff = (unsigned long)diff;
@ -945,7 +945,7 @@ calibrate(void)
} }
#endif #endif
} }
#if defined(MS_WIN32) || defined(macintosh) || defined(PYOS_OS2) #if defined(MS_WINDOWS) || defined(macintosh) || defined(PYOS_OS2)
rusage_diff = -1; rusage_diff = -1;
#else #else
{ {
@ -1448,7 +1448,7 @@ write_header(ProfilerObject *self)
else else
pack_add_info(self, "executable-version", buffer); pack_add_info(self, "executable-version", buffer);
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%I64d", frequency.QuadPart); PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%I64d", frequency.QuadPart);
pack_add_info(self, "reported-performance-frequency", cwdbuffer); pack_add_info(self, "reported-performance-frequency", cwdbuffer);
#else #else
@ -1553,7 +1553,7 @@ hotshot_coverage(PyObject *unused, PyObject *args)
} }
PyDoc_VAR(resolution__doc__) = PyDoc_VAR(resolution__doc__) =
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyDoc_STR( PyDoc_STR(
"resolution() -> (performance-counter-ticks, update-frequency)\n" "resolution() -> (performance-counter-ticks, update-frequency)\n"
"Return the resolution of the timer provided by the QueryPerformanceCounter()\n" "Return the resolution of the timer provided by the QueryPerformanceCounter()\n"
@ -1580,7 +1580,7 @@ hotshot_resolution(PyObject *unused, PyObject *args)
calibrate(); calibrate();
calibrate(); calibrate();
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
result = Py_BuildValue("ii", timeofday_diff, frequency.LowPart); result = Py_BuildValue("ii", timeofday_diff, frequency.LowPart);
#else #else
result = Py_BuildValue("ii", timeofday_diff, rusage_diff); result = Py_BuildValue("ii", timeofday_diff, rusage_diff);

View File

@ -25,7 +25,7 @@ This software comes with no warranty. Use at your own risk.
#include <libintl.h> #include <libintl.h>
#endif #endif
#if defined(MS_WIN32) #if defined(MS_WINDOWS)
#define WINDOWS_LEAN_AND_MEAN #define WINDOWS_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#endif #endif
@ -363,7 +363,7 @@ PyLocale_strxfrm(PyObject* self, PyObject* args)
return result; return result;
} }
#if defined(MS_WIN32) #if defined(MS_WINDOWS)
static PyObject* static PyObject*
PyLocale_getdefaultlocale(PyObject* self) PyLocale_getdefaultlocale(PyObject* self)
{ {
@ -627,7 +627,7 @@ static struct PyMethodDef PyLocale_Methods[] = {
METH_VARARGS, strcoll__doc__}, METH_VARARGS, strcoll__doc__},
{"strxfrm", (PyCFunction) PyLocale_strxfrm, {"strxfrm", (PyCFunction) PyLocale_strxfrm,
METH_VARARGS, strxfrm__doc__}, METH_VARARGS, strxfrm__doc__},
#if defined(MS_WIN32) || defined(macintosh) #if defined(MS_WINDOWS) || defined(macintosh)
{"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS}, {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS},
#endif #endif
#ifdef HAVE_LANGINFO_H #ifdef HAVE_LANGINFO_H

View File

@ -20,11 +20,11 @@
#include <Python.h> #include <Python.h>
#ifndef MS_WIN32 #ifndef MS_WINDOWS
#define UNIX #define UNIX
#endif #endif
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
static int static int
my_getpagesize(void) my_getpagesize(void)
@ -75,7 +75,7 @@ typedef struct {
size_t size; size_t size;
size_t pos; size_t pos;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
HANDLE map_handle; HANDLE map_handle;
HANDLE file_handle; HANDLE file_handle;
char * tagname; char * tagname;
@ -92,7 +92,7 @@ typedef struct {
static void static void
mmap_object_dealloc(mmap_object *m_obj) mmap_object_dealloc(mmap_object *m_obj)
{ {
#ifdef MS_WIN32 #ifdef MS_WINDOWS
if (m_obj->data != NULL) if (m_obj->data != NULL)
UnmapViewOfFile (m_obj->data); UnmapViewOfFile (m_obj->data);
if (m_obj->map_handle != INVALID_HANDLE_VALUE) if (m_obj->map_handle != INVALID_HANDLE_VALUE)
@ -101,7 +101,7 @@ mmap_object_dealloc(mmap_object *m_obj)
CloseHandle (m_obj->file_handle); CloseHandle (m_obj->file_handle);
if (m_obj->tagname) if (m_obj->tagname)
PyMem_Free(m_obj->tagname); PyMem_Free(m_obj->tagname);
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
if (m_obj->data!=NULL) { if (m_obj->data!=NULL) {
@ -118,7 +118,7 @@ mmap_close_method(mmap_object *self, PyObject *args)
{ {
if (!PyArg_ParseTuple(args, ":close")) if (!PyArg_ParseTuple(args, ":close"))
return NULL; return NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
/* For each resource we maintain, we need to check /* For each resource we maintain, we need to check
the value is valid, and if so, free the resource the value is valid, and if so, free the resource
and set the member value to an invalid value so and set the member value to an invalid value so
@ -138,7 +138,7 @@ mmap_close_method(mmap_object *self, PyObject *args)
CloseHandle (self->file_handle); CloseHandle (self->file_handle);
self->file_handle = INVALID_HANDLE_VALUE; self->file_handle = INVALID_HANDLE_VALUE;
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
munmap(self->data, self->size); munmap(self->data, self->size);
@ -149,7 +149,7 @@ mmap_close_method(mmap_object *self, PyObject *args)
return (Py_None); return (Py_None);
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#define CHECK_VALID(err) \ #define CHECK_VALID(err) \
do { \ do { \
if (!self->map_handle) { \ if (!self->map_handle) { \
@ -157,7 +157,7 @@ do { \
return err; \ return err; \
} \ } \
} while (0) } while (0)
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
#define CHECK_VALID(err) \ #define CHECK_VALID(err) \
@ -336,7 +336,7 @@ mmap_size_method(mmap_object *self,
if (!PyArg_ParseTuple(args, ":size")) if (!PyArg_ParseTuple(args, ":size"))
return NULL; return NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
if (self->file_handle != INVALID_HANDLE_VALUE) { if (self->file_handle != INVALID_HANDLE_VALUE) {
return (Py_BuildValue ( return (Py_BuildValue (
"l", (long) "l", (long)
@ -344,7 +344,7 @@ mmap_size_method(mmap_object *self,
} else { } else {
return (Py_BuildValue ("l", (long) self->size) ); return (Py_BuildValue ("l", (long) self->size) );
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
{ {
@ -376,7 +376,7 @@ mmap_resize_method(mmap_object *self,
if (!PyArg_ParseTuple (args, "l:resize", &new_size) || if (!PyArg_ParseTuple (args, "l:resize", &new_size) ||
!is_resizeable(self)) { !is_resizeable(self)) {
return NULL; return NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
} else { } else {
DWORD dwErrCode = 0; DWORD dwErrCode = 0;
/* First, unmap the file view */ /* First, unmap the file view */
@ -414,7 +414,7 @@ mmap_resize_method(mmap_object *self,
} }
PyErr_SetFromWindowsErr(dwErrCode); PyErr_SetFromWindowsErr(dwErrCode);
return (NULL); return (NULL);
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
#ifndef HAVE_MREMAP #ifndef HAVE_MREMAP
@ -467,10 +467,10 @@ mmap_flush_method(mmap_object *self, PyObject *args)
"flush values out of range"); "flush values out of range");
return NULL; return NULL;
} else { } else {
#ifdef MS_WIN32 #ifdef MS_WINDOWS
return (Py_BuildValue("l", (long) return (Py_BuildValue("l", (long)
FlushViewOfFile(self->data+offset, size))); FlushViewOfFile(self->data+offset, size)));
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef UNIX #ifdef UNIX
/* XXX semantics of return value? */ /* XXX semantics of return value? */
/* XXX flags for msync? */ /* XXX flags for msync? */
@ -909,7 +909,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
} }
#endif /* UNIX */ #endif /* UNIX */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
static PyObject * static PyObject *
new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
{ {
@ -1042,7 +1042,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
PyErr_SetFromWindowsErr(dwErr); PyErr_SetFromWindowsErr(dwErr);
return (NULL); return (NULL);
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
/* List of functions exported by this module */ /* List of functions exported by this module */
static struct PyMethodDef mmap_functions[] = { static struct PyMethodDef mmap_functions[] = {

View File

@ -4,7 +4,7 @@
/* This file is also used for Windows NT/MS-Win and OS/2. In that case the /* This file is also used for Windows NT/MS-Win and OS/2. In that case the
module actually calls itself 'nt' or 'os2', not 'posix', and a few module actually calls itself 'nt' or 'os2', not 'posix', and a few
functions are either unimplemented or implemented differently. The source functions are either unimplemented or implemented differently. The source
assumes that for Windows NT, the macro 'MS_WIN32' is defined independent assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent
of the compiler used. Different compilers define their own feature of the compiler used. Different compilers define their own feature
test macro, e.g. '__BORLANDC__' or '_MSC_VER'. For OS/2, the compiler test macro, e.g. '__BORLANDC__' or '_MSC_VER'. For OS/2, the compiler
independent macro PYOS_OS2 should be defined. On OS/2 the default independent macro PYOS_OS2 should be defined. On OS/2 the default
@ -82,15 +82,12 @@ corresponding Unix manual entries for more information on calls.");
#else #else
#ifdef _MSC_VER /* Microsoft compiler */ #ifdef _MSC_VER /* Microsoft compiler */
#define HAVE_GETCWD 1 #define HAVE_GETCWD 1
#ifdef MS_WIN32
#define HAVE_SPAWNV 1 #define HAVE_SPAWNV 1
#define HAVE_EXECV 1 #define HAVE_EXECV 1
#define HAVE_PIPE 1 #define HAVE_PIPE 1
#define HAVE_POPEN 1 #define HAVE_POPEN 1
#define HAVE_SYSTEM 1 #define HAVE_SYSTEM 1
#define HAVE_CWAIT 1 #define HAVE_CWAIT 1
#else /* 16-bit Windows */
#endif /* !MS_WIN32 */
#else #else
#if defined(PYOS_OS2) && defined(PYCC_GCC) #if defined(PYOS_OS2) && defined(PYCC_GCC)
/* Everything needed is defined in PC/os2emx/pyconfig.h */ /* Everything needed is defined in PC/os2emx/pyconfig.h */
@ -222,13 +219,8 @@ extern int lstat(const char *, struct stat *);
#include "osdefs.h" #include "osdefs.h"
#define WINDOWS_LEAN_AND_MEAN #define WINDOWS_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifdef MS_WIN32
#define popen _popen #define popen _popen
#define pclose _pclose #define pclose _pclose
#else /* 16-bit Windows */
#include <dos.h>
#include <ctype.h>
#endif /* MS_WIN32 */
#endif /* _MSC_VER */ #endif /* _MSC_VER */
#if defined(PYCC_VACPP) && defined(PYOS_OS2) #if defined(PYCC_VACPP) && defined(PYOS_OS2)
@ -268,7 +260,7 @@ extern int lstat(const char *, struct stat *);
/* choose the appropriate stat and fstat functions and return structs */ /* choose the appropriate stat and fstat functions and return structs */
#undef STAT #undef STAT
#if defined(MS_WIN64) || defined(MS_WIN32) #if defined(MS_WIN64) || defined(MS_WINDOWS)
# define STAT _stati64 # define STAT _stati64
# define FSTAT _fstati64 # define FSTAT _fstati64
# define STRUCT_STAT struct _stati64 # define STRUCT_STAT struct _stati64
@ -367,7 +359,7 @@ posix_error_with_allocated_filename(char* name)
return rc; return rc;
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
static PyObject * static PyObject *
win32_error(char* function, char* filename) win32_error(char* function, char* filename)
{ {
@ -684,17 +676,17 @@ posix_do_stat(PyObject *self, PyObject *args, char *format,
char *pathfree = NULL; /* this memory must be free'd */ char *pathfree = NULL; /* this memory must be free'd */
int res; int res;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
int pathlen; int pathlen;
char pathcopy[MAX_PATH]; char pathcopy[MAX_PATH];
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
if (!PyArg_ParseTuple(args, format, if (!PyArg_ParseTuple(args, format,
Py_FileSystemDefaultEncoding, &path)) Py_FileSystemDefaultEncoding, &path))
return NULL; return NULL;
pathfree = path; pathfree = path;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
pathlen = strlen(path); pathlen = strlen(path);
/* the library call can blow up if the file name is too long! */ /* the library call can blow up if the file name is too long! */
if (pathlen > MAX_PATH) { if (pathlen > MAX_PATH) {
@ -719,7 +711,7 @@ posix_do_stat(PyObject *self, PyObject *args, char *format,
path = pathcopy; path = pathcopy;
} }
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
res = (*statfunc)(path, &st); res = (*statfunc)(path, &st);
@ -991,7 +983,7 @@ posix_listdir(PyObject *self, PyObject *args)
{ {
/* XXX Should redo this putting the (now four) versions of opendir /* XXX Should redo this putting the (now four) versions of opendir
in separate files instead of having them all here... */ in separate files instead of having them all here... */
#if defined(MS_WIN32) && !defined(HAVE_OPENDIR) #if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
PyObject *d, *v; PyObject *d, *v;
HANDLE hFindFile; HANDLE hFindFile;
@ -1047,67 +1039,6 @@ posix_listdir(PyObject *self, PyObject *args)
return d; return d;
#elif defined(_MSC_VER) /* 16-bit Windows */
#ifndef MAX_PATH
#define MAX_PATH 250
#endif
char *name, *pt;
int len;
PyObject *d, *v;
char namebuf[MAX_PATH+5];
struct _find_t ep;
if (!PyArg_ParseTuple(args, "t#:listdir", &name, &len))
return NULL;
if (len >= MAX_PATH) {
PyErr_SetString(PyExc_ValueError, "path too long");
return NULL;
}
strcpy(namebuf, name);
for (pt = namebuf; *pt; pt++)
if (*pt == ALTSEP)
*pt = SEP;
if (namebuf[len-1] != SEP)
namebuf[len++] = SEP;
strcpy(namebuf + len, "*.*");
if ((d = PyList_New(0)) == NULL)
return NULL;
if (_dos_findfirst(namebuf, _A_RDONLY |
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0)
{
errno = ENOENT;
return posix_error_with_filename(name);
}
do {
if (ep.name[0] == '.' &&
(ep.name[1] == '\0' ||
ep.name[1] == '.' &&
ep.name[2] == '\0'))
continue;
strcpy(namebuf, ep.name);
for (pt = namebuf; *pt; pt++)
if (isupper(*pt))
*pt = tolower(*pt);
v = PyString_FromString(namebuf);
if (v == NULL) {
Py_DECREF(d);
d = NULL;
break;
}
if (PyList_Append(d, v) != 0) {
Py_DECREF(v);
Py_DECREF(d);
d = NULL;
break;
}
Py_DECREF(v);
} while (_dos_findnext(&ep) == 0);
return d;
#elif defined(PYOS_OS2) #elif defined(PYOS_OS2)
#ifndef MAX_PATH #ifndef MAX_PATH
@ -1220,7 +1151,7 @@ posix_listdir(PyObject *self, PyObject *args)
#endif /* which OS */ #endif /* which OS */
} /* end of posix_listdir */ } /* end of posix_listdir */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
/* A helper function for abspath on win32 */ /* A helper function for abspath on win32 */
static PyObject * static PyObject *
posix__getfullpathname(PyObject *self, PyObject *args) posix__getfullpathname(PyObject *self, PyObject *args)
@ -1240,7 +1171,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
return win32_error("GetFullPathName", inbuf); return win32_error("GetFullPathName", inbuf);
return PyString_FromString(outbuf); return PyString_FromString(outbuf);
} /* end of posix__getfullpathname */ } /* end of posix__getfullpathname */
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
PyDoc_STRVAR(posix_mkdir__doc__, PyDoc_STRVAR(posix_mkdir__doc__,
"mkdir(path [, mode=0777])\n\n\ "mkdir(path [, mode=0777])\n\n\
@ -3050,7 +2981,7 @@ static int _PyPclose(FILE *file)
#endif /* PYCC_??? */ #endif /* PYCC_??? */
#elif defined(MS_WIN32) #elif defined(MS_WINDOWS)
/* /*
* Portable 'popen' replacement for Win32. * Portable 'popen' replacement for Win32.
@ -4211,7 +4142,7 @@ posix_times(PyObject *self, PyObject *args)
#endif /* HAVE_TIMES */ #endif /* HAVE_TIMES */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#define HAVE_TIMES /* so the method table will pick it up */ #define HAVE_TIMES /* so the method table will pick it up */
static PyObject * static PyObject *
posix_times(PyObject *self, PyObject *args) posix_times(PyObject *self, PyObject *args)
@ -4237,7 +4168,7 @@ posix_times(PyObject *self, PyObject *args)
(double)0, (double)0,
(double)0); (double)0);
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#ifdef HAVE_TIMES #ifdef HAVE_TIMES
PyDoc_STRVAR(posix_times__doc__, PyDoc_STRVAR(posix_times__doc__,
@ -4414,7 +4345,7 @@ static PyObject *
posix_lseek(PyObject *self, PyObject *args) posix_lseek(PyObject *self, PyObject *args)
{ {
int fd, how; int fd, how;
#if defined(MS_WIN64) || defined(MS_WIN32) #if defined(MS_WIN64) || defined(MS_WINDOWS)
LONG_LONG pos, res; LONG_LONG pos, res;
#else #else
off_t pos, res; off_t pos, res;
@ -4441,7 +4372,7 @@ posix_lseek(PyObject *self, PyObject *args)
return NULL; return NULL;
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
#if defined(MS_WIN64) || defined(MS_WIN32) #if defined(MS_WIN64) || defined(MS_WINDOWS)
res = _lseeki64(fd, pos, how); res = _lseeki64(fd, pos, how);
#else #else
res = lseek(fd, pos, how); res = lseek(fd, pos, how);
@ -4590,7 +4521,7 @@ posix_pipe(PyObject *self, PyObject *args)
return Py_BuildValue("(ii)", read, write); return Py_BuildValue("(ii)", read, write);
#else #else
#if !defined(MS_WIN32) #if !defined(MS_WINDOWS)
int fds[2]; int fds[2];
int res; int res;
if (!PyArg_ParseTuple(args, ":pipe")) if (!PyArg_ParseTuple(args, ":pipe"))
@ -4601,7 +4532,7 @@ posix_pipe(PyObject *self, PyObject *args)
if (res != 0) if (res != 0)
return posix_error(); return posix_error();
return Py_BuildValue("(ii)", fds[0], fds[1]); return Py_BuildValue("(ii)", fds[0], fds[1]);
#else /* MS_WIN32 */ #else /* MS_WINDOWS */
HANDLE read, write; HANDLE read, write;
int read_fd, write_fd; int read_fd, write_fd;
BOOL ok; BOOL ok;
@ -4615,7 +4546,7 @@ posix_pipe(PyObject *self, PyObject *args)
read_fd = _open_osfhandle((Py_intptr_t)read, 0); read_fd = _open_osfhandle((Py_intptr_t)read, 0);
write_fd = _open_osfhandle((Py_intptr_t)write, 1); write_fd = _open_osfhandle((Py_intptr_t)write, 1);
return Py_BuildValue("(ii)", read_fd, write_fd); return Py_BuildValue("(ii)", read_fd, write_fd);
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
#endif #endif
} }
#endif /* HAVE_PIPE */ #endif /* HAVE_PIPE */
@ -5189,7 +5120,7 @@ posix_tempnam(PyObject *self, PyObject *args)
"tempnam is a potential security risk to your program") < 0) "tempnam is a potential security risk to your program") < 0)
return NULL; return NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
name = _tempnam(dir, pfx); name = _tempnam(dir, pfx);
#else #else
name = tempnam(dir, pfx); name = tempnam(dir, pfx);
@ -6250,7 +6181,7 @@ posix_abort(PyObject *self, PyObject *args)
return NULL; return NULL;
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyDoc_STRVAR(win32_startfile__doc__, PyDoc_STRVAR(win32_startfile__doc__,
"startfile(filepath) - Start a file with its associated application.\n\ "startfile(filepath) - Start a file with its associated application.\n\
\n\ \n\
@ -6390,7 +6321,7 @@ static PyMethodDef posix_methods[] = {
#endif /* HAVE_PLOCK */ #endif /* HAVE_PLOCK */
#ifdef HAVE_POPEN #ifdef HAVE_POPEN
{"popen", posix_popen, METH_VARARGS, posix_popen__doc__}, {"popen", posix_popen, METH_VARARGS, posix_popen__doc__},
#ifdef MS_WIN32 #ifdef MS_WINDOWS
{"popen2", win32_popen2, METH_VARARGS}, {"popen2", win32_popen2, METH_VARARGS},
{"popen3", win32_popen3, METH_VARARGS}, {"popen3", win32_popen3, METH_VARARGS},
{"popen4", win32_popen4, METH_VARARGS}, {"popen4", win32_popen4, METH_VARARGS},
@ -6542,7 +6473,7 @@ static PyMethodDef posix_methods[] = {
{"pathconf", posix_pathconf, METH_VARARGS, posix_pathconf__doc__}, {"pathconf", posix_pathconf, METH_VARARGS, posix_pathconf__doc__},
#endif #endif
{"abort", posix_abort, METH_VARARGS, posix_abort__doc__}, {"abort", posix_abort, METH_VARARGS, posix_abort__doc__},
#ifdef MS_WIN32 #ifdef MS_WINDOWS
{"_getfullpathname", posix__getfullpathname, METH_VARARGS, NULL}, {"_getfullpathname", posix__getfullpathname, METH_VARARGS, NULL},
#endif #endif
{NULL, NULL} /* Sentinel */ {NULL, NULL} /* Sentinel */

View File

@ -6,7 +6,7 @@
#include "Python.h" #include "Python.h"
#include "intrcheck.h" #include "intrcheck.h"
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include <process.h> #include <process.h>
#endif #endif

View File

@ -29,23 +29,20 @@ extern int ftime(struct timeb *);
#else #else
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
#if defined(MS_WIN16) || defined(__BORLANDC__) #if defined(__BORLANDC__)
/* These overrides not needed for Win32 */ /* These overrides not needed for Win32 */
#define timezone _timezone #define timezone _timezone
#define tzname _tzname #define tzname _tzname
#define daylight _daylight #define daylight _daylight
#endif /* MS_WIN16 || __BORLANDC__ */ #endif /* __BORLANDC__ */
#ifdef MS_WIN16
#define altzone _altzone
#endif /* MS_WIN16 */
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
#endif /* !__WATCOMC__ || __QNX__ */ #endif /* !__WATCOMC__ || __QNX__ */
#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) #if defined(MS_WINDOWS) && !defined(MS_WIN64) && !defined(__BORLANDC__)
/* Win32 has better clock replacement /* Win32 has better clock replacement
XXX Win64 does not yet, but might when the platform matures. */ XXX Win64 does not yet, but might when the platform matures. */
#undef HAVE_CLOCK /* We have our own version down below */ #undef HAVE_CLOCK /* We have our own version down below */
#endif /* MS_WIN32 && !MS_WIN64 */ #endif /* MS_WINDOWS && !MS_WIN64 */
#if defined(PYOS_OS2) #if defined(PYOS_OS2)
#define INCL_DOS #define INCL_DOS
@ -141,7 +138,7 @@ time_clock(PyObject *self, PyObject *args)
} }
#endif /* HAVE_CLOCK */ #endif /* HAVE_CLOCK */
#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) #if defined(MS_WINDOWS) && !defined(MS_WIN64) && !defined(__BORLANDC__)
/* Due to Mark Hammond and Tim Peters */ /* Due to Mark Hammond and Tim Peters */
static PyObject * static PyObject *
time_clock(PyObject *self, PyObject *args) time_clock(PyObject *self, PyObject *args)
@ -170,7 +167,7 @@ time_clock(PyObject *self, PyObject *args)
} }
#define HAVE_CLOCK /* So it gets included in the methods */ #define HAVE_CLOCK /* So it gets included in the methods */
#endif /* MS_WIN32 && !MS_WIN64 */ #endif /* MS_WINDOWS && !MS_WIN64 */
#ifdef HAVE_CLOCK #ifdef HAVE_CLOCK
PyDoc_STRVAR(clock_doc, PyDoc_STRVAR(clock_doc,
@ -736,7 +733,7 @@ floattime(void)
static int static int
floatsleep(double secs) floatsleep(double secs)
{ {
/* XXX Should test for MS_WIN32 first! */ /* XXX Should test for MS_WINDOWS first! */
#if defined(HAVE_SELECT) && !defined(__BEOS__) && !defined(__EMX__) #if defined(HAVE_SELECT) && !defined(__BEOS__) && !defined(__EMX__)
struct timeval t; struct timeval t;
double frac; double frac;
@ -771,36 +768,7 @@ floatsleep(double secs)
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */ delay((int)(secs * 1000 + 0.5)); /* delay() uses milliseconds */
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
#elif defined(MSDOS) #elif defined(MS_WINDOWS)
struct timeb t1, t2;
double frac;
extern double fmod(double, double);
extern double floor(double);
if (secs <= 0.0)
return;
frac = fmod(secs, 1.0);
secs = floor(secs);
ftime(&t1);
t2.time = t1.time + (int)secs;
t2.millitm = t1.millitm + (int)(frac*1000.0);
while (t2.millitm >= 1000) {
t2.time++;
t2.millitm -= 1000;
}
for (;;) {
#ifdef QUICKWIN
Py_BEGIN_ALLOW_THREADS
_wyield();
Py_END_ALLOW_THREADS
#endif
if (PyErr_CheckSignals())
return -1;
ftime(&t1);
if (t1.time > t2.time ||
t1.time == t2.time && t1.millitm >= t2.millitm)
break;
}
#elif defined(MS_WIN32)
{ {
double millisecs = secs * 1000.0; double millisecs = secs * 1000.0;
if (millisecs > (double)ULONG_MAX) { if (millisecs > (double)ULONG_MAX) {

View File

@ -8,7 +8,7 @@
#include <sys/types.h> #include <sys/types.h>
#endif /* DONT_HAVE_SYS_TYPES_H */ #endif /* DONT_HAVE_SYS_TYPES_H */
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#define fileno _fileno #define fileno _fileno
/* can simulate truncate with Win32 API functions; see file_truncate */ /* can simulate truncate with Win32 API functions; see file_truncate */
#define HAVE_FTRUNCATE #define HAVE_FTRUNCATE
@ -480,7 +480,7 @@ file_truncate(PyFileObject *f, PyObject *args)
if (ret != 0) if (ret != 0)
goto onioerror; goto onioerror;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
/* MS _chsize doesn't work if newsize doesn't fit in 32 bits, /* MS _chsize doesn't work if newsize doesn't fit in 32 bits,
so don't even try using it. */ so don't even try using it. */
{ {
@ -542,7 +542,7 @@ file_truncate(PyFileObject *f, PyObject *args)
ret = ftruncate(fileno(f->f_fp), newsize); ret = ftruncate(fileno(f->f_fp), newsize);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (ret != 0) goto onioerror; if (ret != 0) goto onioerror;
#endif /* !MS_WIN32 */ #endif /* !MS_WINDOWS */
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;

View File

@ -41,7 +41,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "unicodeobject.h" #include "unicodeobject.h"
#include "ucnhash.h" #include "ucnhash.h"
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
#endif #endif
@ -2243,7 +2243,7 @@ PyObject *PyUnicode_AsASCIIString(PyObject *unicode)
NULL); NULL);
} }
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T) #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
/* --- MBCS codecs for Windows -------------------------------------------- */ /* --- MBCS codecs for Windows -------------------------------------------- */
@ -2305,7 +2305,7 @@ PyObject *PyUnicode_EncodeMBCS(const Py_UNICODE *p,
return repr; return repr;
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
/* --- Character Mapping Codec -------------------------------------------- */ /* --- Character Mapping Codec -------------------------------------------- */

View File

@ -57,7 +57,7 @@
#include "Python.h" #include "Python.h"
#include "osdefs.h" #include "osdefs.h"
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <tchar.h>
#endif #endif
@ -182,7 +182,7 @@ search_for_prefix(char *argv0_path, char *landmark)
return 0; return 0;
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
/* a string loaded from the DLL at startup.*/ /* a string loaded from the DLL at startup.*/
extern const char *PyWin_DLLVersionString; extern const char *PyWin_DLLVersionString;
@ -340,7 +340,7 @@ done:
free(keyBuf); free(keyBuf);
return retval; return retval;
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
static void static void
get_progpath(void) get_progpath(void)
@ -349,7 +349,7 @@ get_progpath(void)
char *path = getenv("PATH"); char *path = getenv("PATH");
char *prog = Py_GetProgramName(); char *prog = Py_GetProgramName();
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#ifdef UNICODE #ifdef UNICODE
WCHAR wprogpath[MAXPATHLEN+1]; WCHAR wprogpath[MAXPATHLEN+1];
/* Windows documents that GetModuleFileName() will "truncate", /* Windows documents that GetModuleFileName() will "truncate",
@ -423,7 +423,7 @@ calculate_path(void)
char *pythonhome = Py_GetPythonHome(); char *pythonhome = Py_GetPythonHome();
char *envpath = Py_GETENV("PYTHONPATH"); char *envpath = Py_GETENV("PYTHONPATH");
#ifdef MS_WIN32 #ifdef MS_WINDOWS
int skiphome, skipdefault; int skiphome, skipdefault;
char *machinepath = NULL; char *machinepath = NULL;
char *userpath = NULL; char *userpath = NULL;
@ -446,7 +446,7 @@ calculate_path(void)
envpath = NULL; envpath = NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
skiphome = pythonhome==NULL ? 0 : 1; skiphome = pythonhome==NULL ? 0 : 1;
machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome); machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome); userpath = getpythonregpath(HKEY_CURRENT_USER, skiphome);
@ -482,7 +482,7 @@ calculate_path(void)
bufsz = 0; bufsz = 0;
bufsz += strlen(PYTHONPATH) + 1; bufsz += strlen(PYTHONPATH) + 1;
bufsz += strlen(argv0_path) + 1; bufsz += strlen(argv0_path) + 1;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
if (userpath) if (userpath)
bufsz += strlen(userpath) + 1; bufsz += strlen(userpath) + 1;
if (machinepath) if (machinepath)
@ -503,12 +503,12 @@ calculate_path(void)
fprintf(stderr, "Using default static path.\n"); fprintf(stderr, "Using default static path.\n");
module_search_path = PYTHONPATH; module_search_path = PYTHONPATH;
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
if (machinepath) if (machinepath)
free(machinepath); free(machinepath);
if (userpath) if (userpath)
free(userpath); free(userpath);
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
return; return;
} }
@ -517,7 +517,7 @@ calculate_path(void)
buf = strchr(buf, '\0'); buf = strchr(buf, '\0');
*buf++ = DELIM; *buf++ = DELIM;
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
if (userpath) { if (userpath) {
strcpy(buf, userpath); strcpy(buf, userpath);
buf = strchr(buf, '\0'); buf = strchr(buf, '\0');
@ -541,7 +541,7 @@ calculate_path(void)
strcpy(buf, PYTHONPATH); strcpy(buf, PYTHONPATH);
buf = strchr(buf, '\0'); buf = strchr(buf, '\0');
} }
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
else { else {
char *p = PYTHONPATH; char *p = PYTHONPATH;
char *q; char *q;

View File

@ -12,8 +12,7 @@ The code specific to Windows should be wrapped around one of
the following #defines the following #defines
MS_WIN64 - Code specific to the MS Win64 API MS_WIN64 - Code specific to the MS Win64 API
MS_WIN32 - Code specific to the MS Win32 (and Win64) API MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
MS_WIN16 - Code specific to the old 16 bit Windows API.
MS_WINDOWS - Code specific to Windows, but all versions. MS_WINDOWS - Code specific to Windows, but all versions.
MS_COREDLL - Code if the Python core is built as a DLL. MS_COREDLL - Code if the Python core is built as a DLL.
@ -65,9 +64,6 @@ compiler specific". Therefore, these should be very rare.
#define NT /* NT is obsolete - please use MS_WIN32 instead */ #define NT /* NT is obsolete - please use MS_WIN32 instead */
#define MS_WIN32 #define MS_WIN32
#endif #endif
#ifdef _WIN16
#define MS_WIN16
#endif
#define MS_WINDOWS #define MS_WINDOWS
/* set the COMPILER */ /* set the COMPILER */
@ -451,10 +447,7 @@ typedef int pid_t;
/* #define HAVE_ALTZONE */ /* #define HAVE_ALTZONE */
/* Define if you have the putenv function. */ /* Define if you have the putenv function. */
#ifdef MS_WIN32
/* Does this exist on Win16? */
#define HAVE_PUTENV #define HAVE_PUTENV
#endif
/* Define if your compiler supports function prototypes */ /* Define if your compiler supports function prototypes */
#define HAVE_PROTOTYPES #define HAVE_PROTOTYPES

View File

@ -16,7 +16,7 @@
/* The default encoding used by the platform file system APIs /* The default encoding used by the platform file system APIs
Can remain NULL for all platforms that don't have such a concept 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"; const char *Py_FileSystemDefaultEncoding = "mbcs";
#else #else
const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ const char *Py_FileSystemDefaultEncoding = NULL; /* use default */

View File

@ -20,8 +20,6 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
}; };
#ifdef MS_WIN32
/* Case insensitive string compare, to avoid any dependencies on particular /* Case insensitive string compare, to avoid any dependencies on particular
C RTL implementations */ C RTL implementations */
@ -150,7 +148,6 @@ static char *GetPythonImport (HINSTANCE hModule)
return NULL; return NULL;
} }
#endif /* MS_WIN32 */
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, 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); PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname);
#ifdef MS_WIN32
{ {
HINSTANCE hDLL = NULL; HINSTANCE hDLL = NULL;
char pathbuf[260]; char pathbuf[260];
@ -242,31 +238,6 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
} }
p = GetProcAddress(hDLL, funcname); 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; return p;
} }

View File

@ -15,7 +15,7 @@ extern char *strerror(int);
#endif #endif
#endif #endif
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#include "windows.h" #include "windows.h"
#include "winbase.h" #include "winbase.h"
#endif #endif
@ -267,7 +267,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
#ifdef PLAN9 #ifdef PLAN9
char errbuf[ERRMAX]; char errbuf[ERRMAX];
#endif #endif
#ifdef MS_WIN32 #ifdef MS_WINDOWS
char *s_buf = NULL; char *s_buf = NULL;
#endif #endif
#ifdef EINTR #ifdef EINTR
@ -281,7 +281,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
if (i == 0) if (i == 0)
s = "Error"; /* Sometimes errno didn't get set */ s = "Error"; /* Sometimes errno didn't get set */
else else
#ifndef MS_WIN32 #ifndef MS_WINDOWS
s = strerror(i); s = strerror(i);
#else #else
{ {
@ -322,7 +322,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, char *filename)
PyErr_SetObject(exc, v); PyErr_SetObject(exc, v);
Py_DECREF(v); Py_DECREF(v);
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
LocalFree(s_buf); LocalFree(s_buf);
#endif #endif
return NULL; return NULL;

View File

@ -3,7 +3,7 @@
#include "Python.h" #include "Python.h"
#ifdef MS_WIN32 #ifdef MS_WINDOWS
extern void PyWinFreeze_ExeInit(void); extern void PyWinFreeze_ExeInit(void);
extern void PyWinFreeze_ExeTerm(void); extern void PyWinFreeze_ExeTerm(void);
extern int PyInitFrozenExtensions(void); extern int PyInitFrozenExtensions(void);
@ -32,12 +32,12 @@ Py_FrozenMain(int argc, char **argv)
setbuf(stderr, (char *)NULL); setbuf(stderr, (char *)NULL);
} }
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyInitFrozenExtensions(); PyInitFrozenExtensions();
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
Py_SetProgramName(argv[0]); Py_SetProgramName(argv[0]);
Py_Initialize(); Py_Initialize();
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyWinFreeze_ExeInit(); PyWinFreeze_ExeInit();
#endif #endif
@ -60,7 +60,7 @@ Py_FrozenMain(int argc, char **argv)
if (inspect && isatty((int)fileno(stdin))) if (inspect && isatty((int)fileno(stdin)))
sts = PyRun_AnyFile(stdin, "<stdin>") != 0; sts = PyRun_AnyFile(stdin, "<stdin>") != 0;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
PyWinFreeze_ExeTerm(); PyWinFreeze_ExeTerm();
#endif #endif
Py_Finalize(); Py_Finalize();

View File

@ -88,7 +88,7 @@ static const struct filedescr _PyImport_StandardFiletab[] = {
#else #else
static const struct filedescr _PyImport_StandardFiletab[] = { static const struct filedescr _PyImport_StandardFiletab[] = {
{".py", "U", PY_SOURCE}, {".py", "U", PY_SOURCE},
#ifdef MS_WIN32 #ifdef MS_WINDOWS
{".pyw", "U", PY_SOURCE}, {".pyw", "U", PY_SOURCE},
#endif #endif
{".pyc", "rb", PY_COMPILED}, {".pyc", "rb", PY_COMPILED},
@ -548,7 +548,7 @@ make_compiled_pathname(char *pathname, char *buf, size_t buflen)
if (len+2 > buflen) if (len+2 > buflen)
return NULL; return NULL;
#ifdef MS_WIN32 #ifdef MS_WINDOWS
/* Treat .pyw as if it were .py. The case of ".pyw" must match /* Treat .pyw as if it were .py. The case of ".pyw" must match
that used in _PyImport_StandardFiletab. */ that used in _PyImport_StandardFiletab. */
if (len >= 4 && strcmp(&pathname[len-4], ".pyw") == 0) 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 /* 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(). * 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> #include <windows.h>
#ifdef __CYGWIN__ #ifdef __CYGWIN__
#include <sys/cygwin.h> #include <sys/cygwin.h>
@ -1189,8 +1189,8 @@ case_ok(char *buf, int len, int namelen, char *name)
* match the sequence just above. * match the sequence just above.
*/ */
/* MS_WIN32 || __CYGWIN__ */ /* MS_WINDOWS || __CYGWIN__ */
#if defined(MS_WIN32) || defined(__CYGWIN__) #if defined(MS_WINDOWS) || defined(__CYGWIN__)
WIN32_FIND_DATA data; WIN32_FIND_DATA data;
HANDLE h; HANDLE h;
#ifdef __CYGWIN__ #ifdef __CYGWIN__

View File

@ -17,7 +17,7 @@
#include <signal.h> #include <signal.h>
#endif #endif
#ifdef MS_WIN32 #ifdef MS_WINDOWS
#undef BYTE #undef BYTE
#include "windows.h" #include "windows.h"
#endif #endif
@ -1272,14 +1272,14 @@ Py_FatalError(char *msg)
#ifdef macintosh #ifdef macintosh
for (;;); for (;;);
#endif #endif
#ifdef MS_WIN32 #ifdef MS_WINDOWS
OutputDebugString("Fatal Python error: "); OutputDebugString("Fatal Python error: ");
OutputDebugString(msg); OutputDebugString(msg);
OutputDebugString("\n"); OutputDebugString("\n");
#ifdef _DEBUG #ifdef _DEBUG
DebugBreak(); DebugBreak();
#endif #endif
#endif /* MS_WIN32 */ #endif /* MS_WINDOWS */
abort(); abort();
} }

View File

@ -687,7 +687,6 @@ exc_traceback -- traceback of exception currently being handled\n\
because it is thread-safe.\n\ because it is thread-safe.\n\
" "
) )
#ifndef MS_WIN16
/* concatenating string here */ /* concatenating string here */
PyDoc_STR( PyDoc_STR(
"\n\ "\n\
@ -737,7 +736,6 @@ setrecursionlimit() -- set the max recursion depth for the interpreter\n\
settrace() -- set the global debug tracing function\n\ settrace() -- set the global debug tracing function\n\
" "
) )
#endif /* MS_WIN16 */
/* end of sys_doc */ ; /* end of sys_doc */ ;
PyObject * PyObject *