[Python-checkins] CVS: python/dist/src/PC config.h,1.33,1.34

Guido van Rossum python-dev@python.org
Mon, 8 May 2000 10:14:51 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/PC
In directory eric:/projects/python/develop/guido/src/PC

Modified Files:
	config.h 
Log Message:
Trent Mick:

Changes to PC\config.[hc] for Win64. MSVC defines _WINxx to differentiate the
various windows platforms. Python's MS_WINxx are keyed off of these. Note
that _WIN32 (and hence MS_WIN32 in Python) are defined on Win32 *and* on
Win64. This is for compatibility reasons. The idea is that the common case is
that code specific to Win32 will also work on Win64 rather than being
specific to Win32 (i.e. there is more the same than different in WIn32 and
Win64).

The following modules are specifically excluded in the Win64 build:
audioop, binascii, imageop, rgbimg. They are advertised as heavily 32-bit
dependent.  [They should probably be fixed!  --GvR]

The patch to config.h looks big but it really is not. These are the effective
changes:
- MS_WINxx are keyed off _WINxx
- SIZEOF_VOID_P is set to 8 for Win64
- COMPILER string is changed appropriately for Win64


Index: config.h
===================================================================
RCS file: /projects/cvsroot/python/dist/src/PC/config.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** config.h	2000/04/24 15:37:34	1.33
--- config.h	2000/05/08 14:14:48	1.34
***************
*** 12,16 ****
  the following #defines
  
! MS_WIN32 - Code specific to the MS Win32 API
  MS_WIN16 - Code specific to the old 16 bit Windows API.
  MS_WINDOWS - Code specific to Windows, but all versions.
--- 12,17 ----
  the following #defines
  
! MS_WIN64 - Code specific to the MS Win64 API
! MS_WIN32 - Code specific to the MS Win32 (and Win64) API
  MS_WIN16 - Code specific to the old 16 bit Windows API.
  MS_WINDOWS - Code specific to Windows, but all versions.
***************
*** 43,53 ****
  
  /* Microsoft C defines _MSC_VER */
  
! #if defined(_MSC_VER) && _MSC_VER > 850
! /* Start of defines for MS_WIN32 using VC++ 2.0 and up */
  #define NT	/* NT is obsolete - please use MS_WIN32 instead */
  #define MS_WIN32
  #define MS_WINDOWS
  
  /* For NT the Python core is in a DLL by default.  Test the
  standard macro MS_COREDLL to find out.  If you have an exception
--- 44,95 ----
  
  /* Microsoft C defines _MSC_VER */
+ #ifdef _MSC_VER
  
! /* MSVC defines _WINxx to differentiate the windows platform types
! 
!    Note that for compatibility reasons _WIN32 is defined on Win32
!    *and* on Win64. For the same reasons, in Python, MS_WIN32 is
!    defined on Win32 *and* Win64. Win32 only code must therefore be
!    guarded as follows:
!    	#if defined(MS_WIN32) && !defined(MS_WIN64)
! */
! #ifdef _WIN64
! #define MS_WIN64
! #endif
! #ifdef _WIN32
  #define NT	/* NT is obsolete - please use MS_WIN32 instead */
  #define MS_WIN32
+ #endif
+ #ifdef _WIN16
+ #define MS_WIN16
+ #endif
  #define MS_WINDOWS
  
+ /* set the COMPILER */
+ #ifdef MS_WIN64
+ #ifdef _M_IX86
+ #define COMPILER "[MSC 64 bit (Intel)]"
+ #elif defined(_M_ALPHA)
+ #define COMPILER "[MSC 64 bit (Alpha)]"
+ #else
+ #define COMPILER "[MSC 64 bit (Unknown)]"
+ #endif
+ #endif /* MS_WIN64 */
+ 
+ #if defined(MS_WIN32) && !defined(MS_WIN64)
+ #ifdef _M_IX86
+ #define COMPILER "[MSC 32 bit (Intel)]"
+ #elif defined(_M_ALPHA)
+ #define COMPILER "[MSC 32 bit (Alpha)]"
+ #else
+ #define COMPILER "[MSC (Unknown)]"
+ #endif
+ #endif /* MS_WIN32 && !MS_WIN64 */
+ 
+ #endif /* _MSC_VER */
+ 
+ #if defined(_MSC_VER) && _MSC_VER > 850
+ /* Start of defines for MS_WIN32 using VC++ 2.0 and up */
+ 
  /* For NT the Python core is in a DLL by default.  Test the
  standard macro MS_COREDLL to find out.  If you have an exception
***************
*** 60,70 ****
  #endif /* !MS_NO_COREDLL */
  
- #ifdef _M_IX86
- #define COMPILER "[MSC 32 bit (Intel)]"
- #elif defined(_M_ALPHA)
- #define COMPILER "[MSC 32 bit (Alpha)]"
- #else
- #define COMPILER "[MSC (Unknown)]"
- #endif
  #define PYTHONPATH ".\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk"
  typedef int pid_t;
--- 102,105 ----
***************
*** 93,101 ****
  #endif /* _MSC_VER && > 850 */
  
! #if defined(_MSC_VER) && _MSC_VER <= 850
  /* Start of defines for 16-bit Windows using VC++ 1.5 */
  #define COMPILER "[MSC 16-bit]"
- #define MS_WIN16
- #define MS_WINDOWS
  #define PYTHONPATH ".;.\\lib;.\\lib\\plat-win;.\\lib\\dos-8x3"
  #define IMPORT_8x3_NAMES
--- 128,134 ----
  #endif /* _MSC_VER && > 850 */
  
! #if defined(_MSC_VER) && _MSC_VER <= 850 /* presume this implies Win16 */
  /* Start of defines for 16-bit Windows using VC++ 1.5 */
  #define COMPILER "[MSC 16-bit]"
  #define PYTHONPATH ".;.\\lib;.\\lib\\plat-win;.\\lib\\dos-8x3"
  #define IMPORT_8x3_NAMES
***************
*** 201,213 ****
  /* End of compilers - finish up */
  
! #ifdef MS_WIN32
  #define PLATFORM "win32"
  #else
! #ifdef MS_WIN16
  #define PLATFORM "win16"
  #else
  #define PLATFORM "dos"
! #endif /* !MS_WIN16 */
! #endif /* !MS_WIN32 */
  
  #ifdef MS_WIN32
--- 234,253 ----
  /* End of compilers - finish up */
  
! #if defined(MS_WIN64)
! #define PLATFORM "win64"
! #define SIZEOF_VOID_P 8
! #elif defined(MS_WIN32)
  #define PLATFORM "win32"
+ #ifdef _M_ALPHA
+ #define SIZEOF_VOID_P 8
  #else
! #define SIZEOF_VOID_P 4
! #endif
! #elif defined(MS_WIN16)
  #define PLATFORM "win16"
  #else
  #define PLATFORM "dos"
! #endif
! 
  
  #ifdef MS_WIN32
***************
*** 229,238 ****
  #define SIZEOF_LONG 4
  #define SIZEOF_LONG_LONG 8
- 
- #ifdef _M_ALPHA
- #define SIZEOF_VOID_P 8
- #else
- #define SIZEOF_VOID_P 4
- #endif
  
  /* Smaller stack size limit.  (9500 would work too, but we're conservative.) */
--- 269,272 ----