[Python-checkins] CVS: python/dist/src/PC config.h,1.37,1.38
Fred L. Drake
python-dev@python.org
Thu, 29 Jun 2000 13:44:49 -0700
Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv16828/PC
Modified Files:
config.h
Log Message:
This patch extends PC/config.h and configure.in as appropriate for
64-bit readiness (the config values are needed for patches that I will
be submitting later today. The changes are as follows:
- add SIZEOF_OFF_T #define's to PC/config.h (it was already in configure.in)
- add SIZEOF_TIME_T #define to PC/config.h and configure
Needed for some buffer overflow checking because sizeof(time_t) is
different on Win64.
- add SIZEOF_FPOS_T #define
Needed for the Win64 large file support implementation.
- add SIZEOF_HKEY in PC/config.h only
Needed for proper Win32 vs. Win64 handling in PC/winreg.c
- #define HAVE_LARGEFILE_SUPPORT for Win64
- typedef long intptr_t; for all Windows except Win64 (which defines it
itself)
This is a new ANSI (I think) type that is useful (and used by me) for
proper handling in msvcrtmodule.c and posixmodule.c
- indent the nested #ifdef's and #defines in PC/config.h
This is *so* much more readable. There cannot be a compiler
compatibilty issue here can there? Perl uses indented #defines and it
compiles with everything.
Index: config.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/config.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** config.h 2000/06/28 03:54:48 1.37
--- config.h 2000/06/29 20:44:47 1.38
***************
*** 242,262 ****
/* End of compilers - finish up */
#if defined(MS_WIN64)
/* maintain "win32" sys.platform for backward compatibility of Python code,
the Win64 API should be close enough to the Win32 API to make this
preferable */
! #define PLATFORM "win32"
! #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
--- 242,284 ----
/* End of compilers - finish up */
+ /* define the ANSI intptr_t type for portable use of a pointer sized
+ integer */
+ #include <basetsd.h>
+ #if defined(MS_WINDOWS) && !defined(MS_WIN64)
+ typedef long intptr_t;
+ #endif
+
#if defined(MS_WIN64)
/* maintain "win32" sys.platform for backward compatibility of Python code,
the Win64 API should be close enough to the Win32 API to make this
preferable */
! # define PLATFORM "win32"
! # define SIZEOF_VOID_P 8
! # define SIZEOF_TIME_T 8
! # define SIZEOF_OFF_T 4
! # define SIZEOF_FPOS_T 8
! # define SIZEOF_HKEY 8
! /* configure.in defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
! sizeof(off_t) > sizeof(long), and sizeof(LONG_LONG) >= sizeof(off_t).
! On Win64 the second condition is not true, but if fpos_t replaces off_t
! then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
! should define this. */
! # define HAVE_LARGEFILE_SUPPORT
#elif defined(MS_WIN32)
! # define PLATFORM "win32"
! # ifdef _M_ALPHA
! # define SIZEOF_VOID_P 8
! # define SIZEOF_TIME_T 8
! # else
! # define SIZEOF_VOID_P 4
! # define SIZEOF_TIME_T 4
! # define SIZEOF_OFF_T 4
! # define SIZEOF_FPOS_T 8
! # define SIZEOF_HKEY 4
! # endif
#elif defined(MS_WIN16)
! # define PLATFORM "win16"
#else
! # define PLATFORM "dos"
#endif