3
3
4
4
/* pyconfig.h. NOT Generated automatically by configure.
5
5
6
- This is a manually maintained version used for the Watcom,
7
- Borland and Microsoft Visual C++ compilers. It is a
8
- standard part of the Python distribution .
6
+ This is a manually maintained version (initially based
7
+ on "PC/pyconfig.h") used for (i686|x86_64)-w64-mingw32
8
+ toolchains (provided by MXE) .
9
9
10
10
WINDOWS DEFINES:
11
11
The code specific to Windows should be wrapped around one of
@@ -29,18 +29,6 @@ WIN32 is still required for the locale module.
29
29
# define Py_BUILD_CORE
30
30
#endif /* USE_DL_EXPORT */
31
31
32
-
33
- #define HAVE_IO_H
34
- #define HAVE_SYS_UTIME_H
35
- #define HAVE_TEMPNAM
36
- #define HAVE_TMPFILE
37
- #define HAVE_TMPNAM
38
- #define HAVE_CLOCK
39
- #define HAVE_STRERROR
40
- #ifdef HAVE_IO_H
41
- #include <io.h>
42
- #endif
43
-
44
32
#define HAVE_HYPOT
45
33
#define HAVE_STRFTIME
46
34
#define DONT_HAVE_SIG_ALARM
@@ -61,67 +49,53 @@ WIN32 is still required for the locale module.
61
49
#define USE_SOCKET
62
50
#endif
63
51
64
-
65
- /* Compiler specific defines */
66
-
67
52
/* ------------------------------------------------------------------------*/
68
- /* Microsoft C defines _MSC_VER */
69
- #ifdef _MSC_VER
70
-
71
- /* We want COMPILER to expand to a string containing _MSC_VER's *value*.
72
- * This is horridly tricky, because the stringization operator only works
73
- * on macro arguments, and doesn't evaluate macros passed *as* arguments.
74
- * Attempts simpler than the following appear doomed to produce "_MSC_VER"
75
- * literally in the string.
76
- */
53
+ /* (i686|x86_64)-w64-mingw32 toolchains defines __MINGW32__ */
54
+ #ifndef __MINGW32__
55
+ # error "This file is should be used with MingW compiler"
56
+ #endif
57
+
77
58
#define _Py_PASTE_VERSION (SUFFIX ) \
78
- ("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
79
- /* e.g., this produces, after compile-time string catenation,
80
- * ("[MSC v.1200 32 bit (Intel)]")
81
- *
82
- * _Py_STRINGIZE(_MSC_VER) expands to
83
- * _Py_STRINGIZE1((_MSC_VER)) expands to
84
- * _Py_STRINGIZE2(_MSC_VER) but as this call is the result of token-pasting
85
- * it's scanned again for macros and so further expands to (under MSVC 6)
86
- * _Py_STRINGIZE2(1200) which then expands to
87
- * "1200"
88
- */
89
- #define _Py_STRINGIZE (X ) _Py_STRINGIZE1((X))
90
- #define _Py_STRINGIZE1 (X ) _Py_STRINGIZE2 ## X
91
- #define _Py_STRINGIZE2 (X ) #X
92
-
93
- /* MSVC defines _WINxx to differentiate the windows platform types
94
-
95
- Note that for compatibility reasons _WIN32 is defined on Win32
59
+ ("\n[GCC v" __VERSION__ " " SUFFIX "]")
60
+
61
+ #ifndef COMPILER
62
+ # ifdef __MINGW64__
63
+ # define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
64
+ # else
65
+ # define COMPILER _Py_PASTE_VERSION("32 bit (i686)")
66
+ # endif
67
+ #endif /* !COMPILER */
68
+
69
+ /* MinGW defines __MINGWxx__ to differentiate the windows platform types
70
+
71
+ Note that for compatibility reasons __MINGW32__ is defined on Win32
96
72
*and* on Win64. For the same reasons, in Python, MS_WIN32 is
97
73
defined on Win32 *and* Win64. Win32 only code must therefore be
98
74
guarded as follows:
99
75
#if defined(MS_WIN32) && !defined(MS_WIN64)
100
- Some modules are disabled on Itanium processors, therefore we
101
- have MS_WINI64 set for those targets, otherwise MS_WINX64
102
76
*/
103
- #ifdef _WIN64
104
- #define MS_WIN64
77
+
78
+ #if !defined(MS_WIN64 ) && defined(__MINGW64__ )
79
+ # define MS_WIN64
105
80
#endif
106
81
107
- /* set the COMPILER */
108
82
#ifdef MS_WIN64
109
- #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
110
- #endif /* MS_WIN64 */
83
+ # define MS_WINX64
84
+ #endif
111
85
112
86
/* set the version macros for the windows headers */
113
87
#ifdef MS_WINX64
114
88
/* 64 bit only runs on XP or greater */
115
- #define Py_WINVER _WIN32_WINNT_WINXP
116
- #define Py_NTDDI NTDDI_WINXP
89
+ # define Py_WINVER _WIN32_WINNT_WINXP
90
+ # define Py_NTDDI NTDDI_WINXP
117
91
#else
118
92
/* Python 2.6+ requires Windows 2000 or greater */
119
- #ifdef _WIN32_WINNT_WIN2K
120
- #define Py_WINVER _WIN32_WINNT_WIN2K
121
- #else
122
- #define Py_WINVER 0x0500
123
- #endif
124
- #define Py_NTDDI NTDDI_WIN2KSP4
93
+ # ifdef _WIN32_WINNT_WIN2K
94
+ # define Py_WINVER _WIN32_WINNT_WIN2K
95
+ # else
96
+ # define Py_WINVER 0x0500
97
+ # endif
98
+ # define Py_NTDDI NTDDI_WIN2KSP4
125
99
#endif
126
100
127
101
/* We only set these values when building Python - we don't want to force
@@ -132,54 +106,41 @@ WIN32 is still required for the locale module.
132
106
determines at runtime they are available.
133
107
*/
134
108
#if defined(Py_BUILD_CORE ) || defined(Py_BUILD_CORE_MODULE )
135
- #ifndef NTDDI_VERSION
136
- #define NTDDI_VERSION Py_NTDDI
137
- #endif
138
- #ifndef WINVER
139
- #define WINVER Py_WINVER
140
- #endif
141
- #ifndef _WIN32_WINNT
142
- #define _WIN32_WINNT Py_WINVER
143
- #endif
144
- #endif
145
-
146
- /* _W64 is not defined for VC6 or eVC4 */
147
- #ifndef _W64
148
- #define _W64
149
- #endif
109
+ # ifndef NTDDI_VERSION
110
+ # define NTDDI_VERSION Py_NTDDI
111
+ # endif
112
+ # ifndef WINVER
113
+ # define WINVER Py_WINVER
114
+ # endif
115
+ # ifndef _WIN32_WINNT
116
+ # define _WIN32_WINNT Py_WINVER
117
+ # endif
118
+ #endif /* defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE) */
150
119
151
120
/* Define like size_t, omitting the "unsigned" */
152
- #ifdef MS_WIN64
153
- typedef __int64 ssize_t ;
154
- #else
155
- typedef _W64 int ssize_t ;
156
- #endif
157
121
#define HAVE_SSIZE_T 1
158
122
159
- #if defined(MS_WIN32 ) && !defined(MS_WIN64 )
160
- #define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
161
- #endif /* MS_WIN32 && !MS_WIN64 */
162
-
163
- typedef int pid_t ;
164
-
165
123
#include <float.h>
166
124
#define Py_IS_NAN _isnan
167
125
#define Py_IS_INFINITY (X ) (!_finite(X) && !_isnan(X))
168
126
#define Py_IS_FINITE (X ) _finite(X)
169
127
#define copysign _copysign
170
128
171
- #define hypot _hypot
172
-
173
- #endif /* _MSC_VER */
174
-
175
129
#include <basetsd.h>
176
130
177
131
/* ------------------------------------------------------------------------*/
178
132
/* End of compilers - finish up */
179
133
180
- #ifndef NO_STDIO_H
181
- # include <stdio.h>
182
- #endif
134
+ #define HAVE_IO_H
135
+ #define HAVE_SYS_UTIME_H
136
+ #define HAVE_TEMPNAM
137
+ #define HAVE_TMPFILE
138
+ #define HAVE_TMPNAM
139
+ #define HAVE_CLOCK
140
+ #define HAVE_STRERROR
141
+
142
+ #include <io.h>
143
+ #include <stdio.h>
183
144
184
145
/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
185
146
#define HAVE_LONG_LONG 1
@@ -220,7 +181,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
220
181
/* maintain "win32" sys.platform for backward compatibility of Python code,
221
182
the Win64 API should be close enough to the Win32 API to make this
222
183
preferable */
223
- # define PLATFORM "win32"
224
184
# define SIZEOF_VOID_P 8
225
185
# define SIZEOF_TIME_T 8
226
186
# define SIZEOF_OFF_T 4
@@ -234,7 +194,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
234
194
should define this. */
235
195
# define HAVE_LARGEFILE_SUPPORT
236
196
#elif defined(MS_WIN32 )
237
- # define PLATFORM "win32"
238
197
# define HAVE_LARGEFILE_SUPPORT
239
198
# define SIZEOF_VOID_P 4
240
199
# define SIZEOF_OFF_T 4
@@ -261,7 +220,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
261
220
#define HAVE_UINTPTR_T 1
262
221
#define HAVE_INTPTR_T 1
263
222
264
- #endif
223
+ #endif /* MS_WIN32 */
265
224
266
225
/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
267
226
implementation of Python long integers. */
@@ -330,7 +289,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
330
289
#define HAVE_DIRECT_H 1
331
290
332
291
/* Define if you have dirent.h. */
333
- /* #define DIRENT 1 */
292
+ #define HAVE_DIRENT_H 1
334
293
335
294
/* Define to the type of elements in the array set by `getgroups'.
336
295
Usually this is either `int' or `gid_t'. */
0 commit comments