@@ -134,7 +134,20 @@ corresponding Unix manual entries for more information on calls.");
134
134
#else
135
135
#if defined(PYOS_OS2 ) && defined(PYCC_GCC ) || defined(__VMS )
136
136
/* 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 */
138
151
/* Unix functions that the configure script doesn't check for */
139
152
#define HAVE_EXECV 1
140
153
#define HAVE_FORK 1
@@ -156,13 +169,14 @@ corresponding Unix manual entries for more information on calls.");
156
169
#define HAVE_SYSTEM 1
157
170
#define HAVE_WAIT 1
158
171
#define HAVE_TTYNAME 1
172
+ #endif /* __MINGW32__ */
159
173
#endif /* PYOS_OS2 && PYCC_GCC && __VMS */
160
174
#endif /* _MSC_VER */
161
175
#endif /* __BORLANDC__ */
162
176
#endif /* ! __WATCOMC__ || __QNX__ */
163
177
#endif /* ! __IBMC__ */
164
178
165
- #ifndef _MSC_VER
179
+ #if !defined( _MSC_VER ) && !defined( __MINGW32__ )
166
180
167
181
#if defined(__sgi )&& _COMPILER_VERSION >=700
168
182
/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode
@@ -214,7 +228,7 @@ extern int lstat(const char *, struct stat *);
214
228
#endif /* HAVE_LSTAT */
215
229
#endif /* !HAVE_UNISTD_H */
216
230
217
- #endif /* !_MSC_VER */
231
+ #endif /* !_MSC_VER && !__MINGW32__ */
218
232
219
233
#ifdef HAVE_UTIME_H
220
234
#include <utime.h>
@@ -259,7 +273,7 @@ extern int lstat(const char *, struct stat *);
259
273
#endif
260
274
#endif
261
275
262
- #ifdef _MSC_VER
276
+ #if defined( _MSC_VER ) || defined( __MINGW32__ )
263
277
#ifdef HAVE_DIRECT_H
264
278
#include <direct.h>
265
279
#endif
@@ -276,7 +290,7 @@ extern int lstat(const char *, struct stat *);
276
290
#include <shellapi.h> /* for ShellExecute() */
277
291
#define popen _popen
278
292
#define pclose _pclose
279
- #endif /* _MSC_VER */
293
+ #endif /* _MSC_VER || __MINGW32__ */
280
294
281
295
#if defined(PYCC_VACPP ) && defined(PYOS_OS2 )
282
296
#include <io.h>
@@ -1590,7 +1604,7 @@ _pystat_fromstructstat(STRUCT_STAT *st)
1590
1604
return v ;
1591
1605
}
1592
1606
1593
- #ifdef MS_WINDOWS
1607
+ #if defined( MS_WINDOWS ) && !defined( __MINGW32__ )
1594
1608
1595
1609
/* IsUNCRoot -- test whether the supplied path is of the form \\SERVER\SHARE\,
1596
1610
where / can be used in place of \ and the trailing slash is optional.
@@ -9452,7 +9466,7 @@ all_ins(PyObject *d)
9452
9466
}
9453
9467
9454
9468
9455
- #if (defined(_MSC_VER ) || defined(__WATCOMC__ ) || defined(__BORLANDC__ )) && !defined(__QNX__ )
9469
+ #if (defined(_MSC_VER ) || defined(__WATCOMC__ ) || defined(__BORLANDC__ ) || defined( __MINGW32__ ) ) && !defined(__QNX__ )
9456
9470
#define INITFUNC initnt
9457
9471
#define MODNAME "nt"
9458
9472
0 commit comments