diff -ur Python-2.7.orig/Modules/posixmodule.c Python-2.7/Modules/posixmodule.c --- Python-2.7.orig/Modules/posixmodule.c 2010-06-17 18:38:34.000000000 +0200 +++ Python-2.7/Modules/posixmodule.c 2010-10-19 14:12:37.941462697 +0200 @@ -120,7 +120,7 @@ #define HAVE_SYSTEM 1 #define HAVE_WAIT 1 #else -#ifdef _MSC_VER /* Microsoft compiler */ +#if defined(_MSC_VER) || defined(__MINGW32__) /* Microsoft or MinGW compiler */ #define HAVE_GETCWD 1 #define HAVE_SPAWNV 1 #define HAVE_EXECV 1 @@ -173,7 +173,7 @@ #if defined(PYCC_VACPP) extern int mkdir(char *); #else -#if ( defined(__WATCOMC__) || defined(_MSC_VER) ) && !defined(__QNX__) +#if ( defined(__WATCOMC__) || defined(_MSC_VER) || defined(__MINGW32__) ) && !defined(__QNX__) extern int mkdir(const char *); #else extern int mkdir(const char *, mode_t); @@ -258,7 +258,7 @@ #endif #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #ifdef HAVE_DIRECT_H #include #endif @@ -9181,7 +9182,7 @@ } -#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)) && !defined(__QNX__) +#if (defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(__BORLANDC__)) && !defined(__QNX__) #define INITFUNC initnt #define MODNAME "nt" diff -ur Python-2.7.orig/Modules/selectmodule.c Python-2.7/Modules/selectmodule.c --- Python-2.7.orig/Modules/selectmodule.c 2010-05-09 16:46:46.000000000 +0200 +++ Python-2.7/Modules/selectmodule.c 2010-10-19 13:57:58.165463069 +0200 @@ -111,9 +111,9 @@ v = PyObject_AsFileDescriptor( o ); if (v == -1) goto finally; -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) max = 0; /* not used for Win32 */ -#else /* !_MSC_VER */ +#else /* !(defined(_MSC_VER) || defined(__MINGW32__)) */ if (v < 0 || v >= FD_SETSIZE) { PyErr_SetString(PyExc_ValueError, "filedescriptor out of range in select()"); @@ -121,7 +121,7 @@ } if (v > max) max = v; -#endif /* _MSC_VER */ +#endif /* defined(_MSC_VER) || defined(__MINGW32__) */ FD_SET(v, set); /* add object and its file descriptor to the list */ @@ -164,7 +164,7 @@ for (j = 0; fd2obj[j].sentinel >= 0; j++) { fd = fd2obj[j].fd; if (FD_ISSET(fd, set)) { -#ifndef _MSC_VER +#if !(defined(_MSC_VER) || defined(__MINGW32__)) if (fd > FD_SETSIZE) { PyErr_SetString(PyExc_SystemError, "filedescriptor out of range returned in select()"); diff -ur Python-2.7.orig/Modules/signalmodule.c Python-2.7/Modules/signalmodule.c --- Python-2.7.orig/Modules/signalmodule.c 2010-05-09 16:46:46.000000000 +0200 +++ Python-2.7/Modules/signalmodule.c 2010-10-19 13:57:58.165463069 +0200 @@ -7,7 +7,7 @@ #include "intrcheck.h" #ifdef MS_WINDOWS -#include +#include #ifdef HAVE_PROCESS_H #include #endif diff -ur Python-2.7.orig/Python/dynload_win.c Python-2.7/Python/dynload_win.c --- Python-2.7.orig/Python/dynload_win.c 2010-05-09 16:46:46.000000000 +0200 +++ Python-2.7/Python/dynload_win.c 2010-10-19 13:57:58.165463069 +0200 @@ -28,7 +28,7 @@ /* Case insensitive string compare, to avoid any dependencies on particular C RTL implementations */ -static int strcasecmp (char *string1, char *string2) +static int my_strcasecmp (char *string1, char *string2) { int first, second; @@ -257,7 +257,7 @@ import_python = GetPythonImport(hDLL); if (import_python && - strcasecmp(buffer,import_python)) { + my_strcasecmp(buffer,import_python)) { PyOS_snprintf(buffer, sizeof(buffer), "Module use of %.150s conflicts " "with this version of Python.",