@@ -13,7 +13,7 @@ the following #defines
1313
1414MS_WIN64 - Code specific to the MS Win64 API
1515MS_WIN32 - Code specific to the MS Win32 (and Win64) API (obsolete, this covers all supported APIs)
16- MS_WINDOWS - Code specific to Windows, but all versions.
16+ MS_WIN64, MS_WIN32, or MS_WINDOWS - Defined later in "pyport.h"
1717Py_ENABLE_SHARED - Code if the Python core is built as a DLL.
1818
1919Also note that neither "_M_IX86" or "_MSC_VER" should be used for
@@ -65,8 +65,6 @@ WIN32 is still required for the locale module.
6565#define LONG_BIT 32
6666#define WORD_BIT 32
6767
68- #define MS_WIN32 /* only support win32 and greater. */
69- #define MS_WINDOWS
7068#ifndef PYTHONPATH
7169# define PYTHONPATH L".\\DLLs;.\\lib"
7270#endif
@@ -105,20 +103,14 @@ WIN32 is still required for the locale module.
105103#define _Py_STRINGIZE1 (X ) _Py_STRINGIZE2 ## X
106104#define _Py_STRINGIZE2 (X ) #X
107105
108- /* MSVC defines _WINxx to differentiate the windows platform types
109-
110- Note that for compatibility reasons _WIN32 is defined on Win32
111- *and* on Win64. For the same reasons, in Python, MS_WIN32 is
112- defined on Win32 *and* Win64. Win32 only code must therefore be
113- guarded as follows:
114- #if defined(MS_WIN32) && !defined(MS_WIN64)
106+ /* set the COMPILER
115107*/
116108#ifdef _WIN64
117109#define MS_WIN64
118110#endif
119111
120112/* set the COMPILER */
121- #ifdef MS_WIN64
113+ #ifdef _WIN64
122114#if defined(_M_X64 ) || defined(_M_AMD64 )
123115#if defined(__INTEL_COMPILER )
124116#define COMPILER ("[ICC v." _Py_STRINGIZE(__INTEL_COMPILER) " 64 bit (amd64) with MSC v." _Py_STRINGIZE(_MSC_VER) " CRT]")
@@ -129,7 +121,7 @@ WIN32 is still required for the locale module.
129121#else
130122#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
131123#endif
132- #endif /* MS_WIN64 */
124+ #endif /* _WIN64 */
133125
134126/* set the version macros for the windows headers */
135127/* Python 3.5+ requires Windows Vista or greater */
@@ -161,14 +153,14 @@ WIN32 is still required for the locale module.
161153#endif
162154
163155/* Define like size_t, omitting the "unsigned" */
164- #ifdef MS_WIN64
156+ #ifdef _WIN64
165157typedef __int64 ssize_t ;
166158#else
167159typedef _W64 int ssize_t ;
168160#endif
169161#define HAVE_SSIZE_T 1
170162
171- #if defined( MS_WIN32 ) && !defined( MS_WIN64 )
163+ #ifndef _WIN64
172164#if defined(_M_IX86 )
173165#if defined(__INTEL_COMPILER )
174166#define COMPILER ("[ICC v." _Py_STRINGIZE(__INTEL_COMPILER) " 32 bit (Intel) with MSC v." _Py_STRINGIZE(_MSC_VER) " CRT]")
@@ -182,7 +174,7 @@ typedef _W64 int ssize_t;
182174#else
183175#define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
184176#endif
185- #endif /* MS_WIN32 && !MS_WIN64 */
177+ #endif /* !_WIN64 */
186178
187179typedef int pid_t ;
188180
@@ -281,7 +273,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
281273# endif /* Py_BUILD_CORE */
282274#endif /* MS_COREDLL */
283275
284- #if defined(MS_WIN64 )
276+ #if defined(_WIN64 )
285277/* maintain "win32" sys.platform for backward compatibility of Python code,
286278 the Win64 API should be close enough to the Win32 API to make this
287279 preferable */
@@ -298,7 +290,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
298290 then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
299291 should define this. */
300292# define HAVE_LARGEFILE_SUPPORT
301- #elif defined( MS_WIN32 )
293+ #else
302294# define PLATFORM "win32"
303295# define HAVE_LARGEFILE_SUPPORT
304296# define SIZEOF_VOID_P 4
@@ -319,8 +311,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
319311#endif
320312
321313
322- #ifdef MS_WIN32
323-
324314#define SIZEOF_SHORT 2
325315#define SIZEOF_INT 4
326316#define SIZEOF_LONG 4
@@ -342,8 +332,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
342332#endif /* _MSC_VER > 1300 */
343333#endif /* _MSC_VER */
344334
345- #endif
346-
347335/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
348336 implementation of Python integers. */
349337#define PY_UINT32_T uint32_t
0 commit comments