[Python-Dev] Patch wanted

Scott David Daniels Scott.Daniels at Acm.Org
Thu Oct 14 23:56:55 CEST 2004


Ray Hettinger's fix 1.29 to PC/pyconfig.h:

Revision 1.29  - (view) (download) (annotate) - [select for diffs]
CVS Tags: r24a2, r24a3
Changes since 1.28: +4 -2 lines

Restore compilation on MSVC++ 6.0

===================================
/* Atleast VC 7.1 has them. If some compiler does not provide them,
    #ifdef appropriately .*/
  #define HAVE_UINTPTR_T 1
  #define HAVE_INTPTR_T 1

===================================
/* VC 7.1 has them and VC 6.0 does not.  VC 6.0 has a version number of 
1200.
   If some compiler does not provide them, modify the #if appropriately. */
#if _MSC_VER != 1200
#define HAVE_UINTPTR_T 1
#define HAVE_INTPTR_T 1
#endif
===================================

Tests the wrong thing.  His test presumes every non VC 7.1 PC compiler
has those types defined.   For non-MSC compilers, _MSC_VER is undefined,
and the expression
     #if _MSC_VER != 1200
becomes:
     #if 0 != 1200
(Not what was intended, I presume).  Even:
     #if _MSC_VER >= 1200
would be preferable (better failure, will presumably work with VC 7.2),
but I believe the correct test should be:
     #if HAVE_STD_INT
as I inexpertly explained in patch 1020042.

This affects any C compilers on Windows that don't have the uintptr_t
and intptr_t types (those without the newer include file stdint.h)
except VC 6.0.  Such compilers cannot compile any file that contains
     #include "Python.h"
I think this needs to be fixed before 2.4 goes out.

-- 
-- Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-Dev mailing list