@@ -134,7 +134,20 @@ corresponding Unix manual entries for more information on calls.");
134134#else
135135#if defined(PYOS_OS2 ) && defined(PYCC_GCC ) || defined(__VMS )
136136/* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */
137- #else /* all other compilers */
137+ #else
138+ #if defined(__MINGW32__ )
139+ #define HAVE_EXECV 1
140+ #if defined(__USLC__ ) && defined(__SCO_VERSION__ ) /* SCO UDK Compiler */
141+ #define HAVE_FORK1 1
142+ #endif
143+ #define HAVE_GETCWD 1
144+ #define HAVE_OPENDIR 1
145+ #define HAVE_PIPE 1
146+ #ifndef __rtems__
147+ #define HAVE_POPEN 1
148+ #endif
149+ #define HAVE_SYSTEM 1
150+ #else /* all other compilers */
138151/* Unix functions that the configure script doesn't check for */
139152#define HAVE_EXECV 1
140153#define HAVE_FORK 1
@@ -156,13 +169,14 @@ corresponding Unix manual entries for more information on calls.");
156169#define HAVE_SYSTEM 1
157170#define HAVE_WAIT 1
158171#define HAVE_TTYNAME 1
172+ #endif /* __MINGW32__ */
159173#endif /* PYOS_OS2 && PYCC_GCC && __VMS */
160174#endif /* _MSC_VER */
161175#endif /* __BORLANDC__ */
162176#endif /* ! __WATCOMC__ || __QNX__ */
163177#endif /* ! __IBMC__ */
164178
165- #ifndef _MSC_VER
179+ #if !defined( _MSC_VER ) && !defined( __MINGW32__ )
166180
167181#if defined(__sgi )&& _COMPILER_VERSION >=700
168182/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode
@@ -214,7 +228,7 @@ extern int lstat(const char *, struct stat *);
214228#endif /* HAVE_LSTAT */
215229#endif /* !HAVE_UNISTD_H */
216230
217- #endif /* !_MSC_VER */
231+ #endif /* !_MSC_VER && !__MINGW32__ */
218232
219233#ifdef HAVE_UTIME_H
220234#include <utime.h>
@@ -259,7 +273,7 @@ extern int lstat(const char *, struct stat *);
259273#endif
260274#endif
261275
262- #ifdef _MSC_VER
276+ #if defined( _MSC_VER ) || defined( __MINGW32__ )
263277#ifdef HAVE_DIRECT_H
264278#include <direct.h>
265279#endif
@@ -275,7 +289,7 @@ extern int lstat(const char *, struct stat *);
275289#include <shellapi.h> /* for ShellExecute() */
276290#define popen _popen
277291#define pclose _pclose
278- #endif /* _MSC_VER */
292+ #endif /* _MSC_VER || __MINGW32__ */
279293
280294#if defined(PYCC_VACPP ) && defined(PYOS_OS2 )
281295#include <io.h>
@@ -1514,7 +1528,7 @@ _pystat_fromstructstat(STRUCT_STAT *st)
15141528 return v ;
15151529}
15161530
1517- #ifdef MS_WINDOWS
1531+ #if defined( MS_WINDOWS ) && !defined( __MINGW32__ )
15181532
15191533/* IsUNCRoot -- test whether the supplied path is of the form \\SERVER\SHARE\,
15201534 where / can be used in place of \ and the trailing slash is optional.
@@ -9332,7 +9346,7 @@ all_ins(PyObject *d)
93329346}
93339347
93349348
9335- #if (defined(_MSC_VER ) || defined(__WATCOMC__ ) || defined(__BORLANDC__ )) && !defined(__QNX__ )
9349+ #if (defined(_MSC_VER ) || defined(__WATCOMC__ ) || defined(__BORLANDC__ ) || defined( __MINGW32__ ) ) && !defined(__QNX__ )
93369350#define INITFUNC initnt
93379351#define MODNAME "nt"
93389352
0 commit comments