@@ -10,6 +10,22 @@ This is a manually maintained version used for the Watcom,
1010Borland and and Microsoft Visual C++ compilers. It is a
1111standard part of the Python distribution.
1212
13+ WINDOWS DEFINES:
14+ The code specific to Windows should be wrapped around one of
15+ the following #defines
16+
17+ MS_WIN32 - Code specific to the MS Win32 API
18+ MS_WIN16 - Code specific to the old 16 bit Windows API.
19+ MS_WINDOWS - Code specific to Windows, but all versions.
20+ MS_COREDLL - Code if the Python core is built as a DLL.
21+
22+ Note that the old defines "NT" and "WIN32" are still supported, but
23+ will soon be dropped.
24+
25+ Also note that neither "_M_IX86" or "_MSC_VER" should be used for
26+ any purpose other than "Windows Intel x86 specific" and "Microsoft
27+ compiler specific". Therefore, these should be very rare.
28+
1329*/
1430
1531/*
@@ -25,6 +41,8 @@ standard part of the Python distribution.
2541#define DONT_HAVE_SIG_ALARM
2642#define DONT_HAVE_SIG_PAUSE
2743#define LONG_BIT 32
44+ #define PREFIX ""
45+ #define EXEC_PREFIX ""
2846
2947/* Microsoft C defines _MSC_VER */
3048
@@ -33,12 +51,20 @@ standard part of the Python distribution.
3351#define NT /* NT is obsolete - please use MS_WIN32 instead */
3452#define MS_WIN32
3553#define MS_WINDOWS
54+
55+ #ifdef MS_COREDLL /* Python core is in a DLL */
56+ #define main Py_Main
57+ #ifndef USE_DL_EXPORT
58+ #define USE_DL_IMPORT
59+ #endif /* !USE_DL_EXPORT */
60+ #endif /* MS_COREDLL */
61+
3662#ifdef _M_IX86
3763#define COMPILER "[MSC 32 bit (Intel)]"
3864#else
3965#define COMPILER "[MSC (Unknown)]"
4066#endif
41- #define PYTHONPATH "c:\\python\\ lib;c:\\python \\lib\\win"
67+ #define PYTHONPATH ".\\ lib;. \\lib\\win"
4268typedef int pid_t ;
4369#define WORD_BIT 32
4470#pragma warning(disable:4113)
@@ -48,7 +74,6 @@ typedef int pid_t;
4874#define HAVE_STRFTIME
4975#define NT_THREADS
5076#define WITH_THREAD
51- #define _COMPLEX_DEFINED
5277#ifndef NETSCAPE_PI
5378#define USE_SOCKET
5479#endif
@@ -58,7 +83,8 @@ typedef int pid_t;
5883#ifdef USE_DL_EXPORT
5984#define DL_IMPORT (RTYPE ) __declspec(dllexport) RTYPE
6085#endif
61- #endif /* MS_WIN32 */
86+
87+ #endif /* _MSC_VER && > 850 */
6288
6389#if defined(_MSC_VER ) && _MSC_VER <= 850
6490/* Start of defines for 16-bit Windows using VC++ 1.5 */
@@ -67,11 +93,10 @@ typedef int pid_t;
6793#define MS_WIN16
6894#define MS_WINDOWS
6995#endif
70- #define PYTHONPATH "c:\\python\\ lib;c:\\python\\ lib\\win;c:\\python \\lib\\dos_8x3"
96+ #define PYTHONPATH ".;.\\ lib;.\\ lib\\win;. \\lib\\dos_8x3"
7197#define IMPORT_8x3_NAMES
7298typedef int pid_t ;
7399#define WORD_BIT 16
74- #define _COMPLEX_DEFINED
75100#pragma warning(disable:4113)
76101#define memcpy memmove /* memcpy dangerous pointer wrap in Win 3.1 */
77102#define hypot _hypot
@@ -109,7 +134,7 @@ int sscanf(const char *, const char *, ...);
109134/* The Watcom compiler defines __WATCOMC__ */
110135#ifdef __WATCOMC__
111136#define COMPILER "[Watcom]"
112- #define PYTHONPATH "c:\\python\\ lib;c:\\python\\ lib\\win;c:\\python \\lib\\dos_8x3"
137+ #define PYTHONPATH ".;.\\ lib;.\\ lib\\win;. \\lib\\dos_8x3"
113138#define IMPORT_8x3_NAMES
114139#include <ctype.h>
115140#include <direct.h>
@@ -144,7 +169,7 @@ typedef int pid_t;
144169/* The Borland compiler defines __BORLANDC__ */
145170#ifdef __BORLANDC__
146171#define COMPILER "[Borland]"
147- #define PYTHONPATH "c:\\python\\ lib;c:\\python\\ lib\\win;c:\\python \\lib\\dos_8x3"
172+ #define PYTHONPATH ".;.\\ lib;.\\ lib\\win;. \\lib\\dos_8x3"
148173#define IMPORT_8x3_NAMES
149174#define HAVE_CLOCK
150175#define HAVE_STRFTIME
@@ -153,6 +178,18 @@ typedef int pid_t;
153178#endif
154179#endif /* BORLANDC */
155180
181+ /* End of compilers - finish up */
182+
183+ #ifdef MS_WIN32
184+ #define PLATFORM "win32"
185+ #else
186+ #ifdef MS_WIN16
187+ #define PLATFORM "win16"
188+ #else
189+ #define PLATFORM "dos"
190+ #endif /* !MS_WIN16 */
191+ #endif /* !MS_WIN32 */
192+
156193/* Fairly standard from here! */
157194
158195/* Define if on AIX 3.
@@ -257,7 +294,7 @@ typedef int pid_t;
257294 This requires the "dl" library by Jack Jansen,
258295 ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
259296 Don't bother on IRIX 5, it already has dynamic linking using SunOS
260- style shared libraries */
297+ style shared libraries */
261298/* #undef WITH_SGI_DL */
262299
263300/* Define if you want to emulate SGI (IRIX 4) dynamic linking.
@@ -268,7 +305,7 @@ typedef int pid_t;
268305 as well as the "GNU dld" library,
269306 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z.
270307 Don't bother on SunOS 4 or 5, they already have dynamic linking using
271- shared libraries */
308+ shared libraries */
272309/* #undef WITH_DL_DLD */
273310
274311/* Define if you want to compile in rudimentary thread support */
0 commit comments